LockSemaphore()
function:
int32 LockSemaphore( Item s, uint32 flags )
s
argument is the item number of the semaphore for the resource you want to lock. Use the flags
argument to specify what to do if the resource is already locked: if you include the SEM_WAIT
flag, your task is put into wait state until the resource is available.
LockSemaphore()
returns 1 if the resource was locked successfully. If the
resource is already locked and you did not include the SEM_WAIT
flag in the flags argument, the function returns 0. If an error occurs, the function returns a negative error code.