Guardian Procedure Calls Reference Manual (G06.25+)
Guardian Procedure Calls (A-B)
Guardian Procedure Calls Reference Manual—522629-013
2-62
BINSEM_FORCELOCK_ Procedure
4045 Deadlock. The binary semaphore was forsaken before the procedure call,
and it is now locked. The corresponding
errno value is EDEADLK.
4103 Already locked. The binary semaphore was locked by the calling process
before the procedure call, and it remains locked. The corresponding
errno value is EALREADY.
semid input
INT (32):value
specifies the binary semaphore ID.
processhandle output
INT .EXT:ref:10
returns the process handle of the process that previously held the lock on the
binary semaphore. A null process handle (-1 in each word) is returned if the binary
semaphore was previously unlocked. If
status is 4045 or 4103,
processhandle is not updated.
Considerations
•
The force-lock operation and the state of the binary semaphore
•
If the binary semaphore is locked by another process, then the value of
status is 0, the state of the binary semaphore becomes locked by the calling
process, and
processhandle contains the process handle of the process
that previously held the lock on the binary semaphore.
•
If the binary semaphore is locked by the calling process, then the value of
status is 4103, the state of the binary semaphore becomes locked by the
calling process, and
processhandle is not updated.
•
If the binary semaphore is unlocked, then the value of status is 0, the state of
the binary semaphore becomes locked by the calling process, and
processhandle contains a null process handle.
•
If the binary semaphore is forsaken, then the value of status is 4045, the
state of the binary semaphore becomes locked, and
processhandle is not
updated.
•
For information about binary semaphores, see “General Considerations for Binary
Semaphores” for the BINSEM_CREATE_ procedure.
Example
status := BINSEM_FORCELOCK_( semid, processhandle );
Note. There are additional considerations for privileged callers.