The low-level routines allow for parallel processes and asynchronous routines to operate in a real-time or multi-tasking environment.
1 – ADD_ATOMIC
The ADD_ATOMIC function adds the value of an expression to the
value of a variable, stores the newly computed value, and
returns the previous value.
Syntax:
ADD_ATOMIC(e,v)
The type of the expression 'e' must be assignment compatbile
with that of the variable 'v'. The variable 'v' must be an
INTEGER, UNSIGNED, INTEGER64, or UNSIGNED64 variable and must be
allocated on a natural boundary (ie, longword for INTEGER and
UNSIGNED and quadword for INTEGER64 and UNSIGNED64). The result
of ADD_ATOMIC is the same type as the variable 'v'.
Overflow and subrange checking are never performed on the
ADD_ATOMIC operation, even if these options are in effect for
the rest of the function or compilation unit.
2 – ADD_INTERLOCKED
The ADD_INTERLOCKED function adds the value of an expression to
the value of a variable, stores the newly computed value in the
variable, and returns an integer value: -1 if the new value is
negative, 0 if it is zero, and 1 if it is positive.
Syntax:
ADD_INTERLOCKED( e, v )
The type of the expression 'e' must be assignment compatible
with that of the variable 'v'. The variable 'v' must be an
integer or an unsigned subrange; 'v' must have an allocation
size of two bytes and must be aligned on a word boundary. The
type of 'e' must be assignment compatible with that of 'v'.
3 – AND_ATOMIC
The AND_ATOMIC function logically ANDs the value of an
expression to the value of a variable, stores the newly computed
value, and returns the previous value.
Syntax:
AND_ATOMIC(e,v)
The type of the expression 'e' must be assignment compatbile
with that of the variable 'v'. The variable v must be an
INTEGER, UNSIGNED, INTEGER64, or UNSIGNED64 variable and must be
allocated on a natural boundary (ie, longword for INTEGER and
UNSIGNED and quadword for INTEGER64 and UNSIGNED64). The result
of AND_ATOMIC is the same type as the variable 'v'.
4 – BARRIER
The BARRIER procedure causes a memory barrier instruction to be
emitted to synchronize pending memory updates in a
multi-processor environment.
Syntax:
BARRIER
The BARRIER procedure has no parameters.
5 – CLEAR_INTERLOCKED
The CLEAR_INTERLOCKED function assigns the value FALSE to the
parameter and returns the original Boolean value of the
parameter.
Syntax:
CLEAR_INTERLOCKED( b )
The variable 'b' must be a variable of type Boolean. The
variable does not have to be aligned; therefore, it can be a
field of a packed record.
6 – OR_ATOMIC
The OR_ATOMIC function logically ORs the value of an expression
to the value of a variable, stores the newly computed value, and
returns the previous value.
Syntax:
OR_ATOMIC(e,v)
The type of the expression 'e' must be assignment compatbile
with that of the variable 'v'. The variable v must be an
INTEGER, UNSIGNED, INTEGER64, or UNSIGNED64 variable and must be
allocated on a natural boundary (ie, longword for INTEGER and
UNSIGNED and quadword for INTEGER64 and UNSIGNED64). The result
of OR_ATOMIC is the same type as the variable 'v'.
7 – SET_INTERLOCKED
The SET_INTERLOCKED function assigns the value TRUE to the
parameter and returns its original Boolean value.
Syntax:
SET_INTERLOCKED( b )
The variable 'b' must be a variable of type Boolean. The
variable does not have to be aligned; therefore, it can be a
field of a packed record.