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.

Return value

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

Supported OS

All

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