Guardian Procedure Calls Reference Manual (G06.25+)

Guardian Procedure Calls (A-B)
Guardian Procedure Calls Reference Manual522629-013
2-56
BINSEM_CLOSE_ Procedure
Considerations
The close operation and the state of the binary semaphore
If the binary semaphore is locked by the calling process, then the value of
error is 4045, the state of the binary semaphore remains unchanged, and
the specified binary semaphore ID can continue to provide access to the binary
semaphore.
If the binary semaphore is either unlocked, forsaken, or locked by another
process, then the value of
error is 0, the state of the binary semaphore
remains unchanged (provided that this is not the last close of the binary
semaphore), and the specified binary semaphore ID can no longer provide
access to the binary semaphore.
When there are no more concurrent opens of the binary semaphore, space used
by the binary semaphore is returned to the system main-memory pool.
A closed binary semaphore ID can be reassigned on subsequent calls to the
BINSEM_CREATE_ and BINSEM_OPEN_ procedures.
For information about binary semaphores, see “General Considerations for Binary
Semaphores” for the BINSEM_CREATE_ procedure.
Example
error := BINSEM_CLOSE_( semid );
Related Programming Manuals
For programming information about the BINSEM_CLOSE_ procedure, refer to the
Guardian Programmer’s Guide.
Note. There are additional considerations for privileged callers.