TSPutExclusiveSemaphore()

Syntax

TSPutExclusiveSemaphore(semaphore)

Description

This command will put the semaphore back, increasing its availability. This then allows the semaphore to be available for threads which are trying to get it. This command works for both the simple semaphore type and the exclusive section of complex semaphores.

Paramaters:
semaphore.l - The handle of the semaphore which was created with TSCreateSemaphore()

Return value:
The value returned by this command is the availability of the semaphore (simple or exclusive part of complex) when it is put back, or -1 if the command failed for some reason. Note, that may not be the current state by the time you check this value as other threads may have got or put back the semaphore since it was put back. Therefore the return value may or may not be of use, it depends what (if anything) you want to do with it.

Example:


See also:
TSCreateSemaphore() , TSGetExclusiveSemaphore()

Supported OS

Windows

ThreadSync - Index