TSSemaphoreCount()

Syntax

TSSemaphoreCount(semaphore)

Description

This command will find out the current availability of either a simple semaphore or the shared section of a complex semaphore.

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 shared 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 the availability was checked. 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() , TSGetSemaphore() , TSPutSemaphore()

Supported OS

Windows

ThreadSync - Index