CBL_SEMAPHORE_ACQUIRE
Acquires one of the resources represented by the semaphore by decrementing
the associated count.
Syntax:
call "CBL_SEMAPHORE_ACQUIRE" using by value semaphore-handle
by value nowait-flag
Parameters:
|
Using call prototype (see Library Routines - Key) |
Picture (32-bit systems) |
semaphore-handle |
cblt-pointer |
usage pointer. |
nowait-flag |
cblt-os-flags |
pic x(4) comp-5. |
On Entry:
semaphore-handle |
Semaphore handle. |
nowait-flag |
A 32-bit value that determines the action of the routine if the count is
zero:
Bit |
Meaning |
0 |
0 |
Block the thread/process until the count is non-zero, then the count is decremented
and the call returns. |
1 |
Return immediately with a non-zero return-value, without decrementing the
count. | |
1-31 |
Reserved. Must be set to zero. | |
On Exit:
Comments:
Behavior is undefined if semaphore-handle is invalid.
See Also: