Guardian Procedure Calls Reference Manual
BINSEM_LOCK_ Procedure
Summary
Syntax for C Programmers
Syntax for TAL Programmers
Parameters
Returned Value
Considerations
Example
Summary
The BINSEM_LOCK_ procedure locks a binary semaphore.
Syntax for C Programmers
#include <cextdecs(BINSEM_LOCK_)>
short BINSEM_LOCK_ ( __int32_t semid
,__int32_t timeout );
Syntax for TAL Programmers
status := BINSEM_LOCK_ ( semid ! i
,timeout ); ! i
Parameters
semid
input
INT (32):value
specifies the binary semaphore ID.
timeout
input
INT (32):value
specifies how many hundredths of a second the procedure waits for the binary semaphore to
become unlocked. The maximum value is 2,147,483,647. A value of -1D causes the procedure
to wait indefinitely. A value of 0D causes the procedure to return immediately to the calling
process, regardless of whether the binary semaphore is locked.
Returned Value
INT
Outcome of the call:
No error. The binary semaphore becomes locked.0
Operation timed out. The timeout value was reached before the binary semaphore could be locked. The
corresponding errno value is EAGAIN.
4011
Invalid parameter. The semid parameter does not identify a binary semaphore that is opened by the calling
process. The corresponding errno value is EINVAL.
4022
Deadlock. The binary semaphore was forsaken before the procedure call, and it is now locked. The
corresponding errno value is EDEADLK.
4045
BINSEM_LOCK_ Procedure 99