TrySemaphore()

Syntax

Result = TrySemaphore(Semaphore)
Description
Decreases the internal count of the semaphore by one only if the count is above 0. This is the same as a WaitSemaphore() operation, but without blocking if the count would fall below 0.

Parameters

Semaphore The semaphore to use.

Return value

Nonzero if the semaphore count was decreased, or zero if the count could not be decreased because it was already zero.

Supported OS

All

<- TryLockMutex() - Thread Index - UnlockMutex() ->