WaitSemaphore()

Syntax

WaitSemaphore(Semaphore)
Description
Decreases the internal count of the semaphore by one, blocking thread execution if the count would fall below zero. A blocked thread is resumed as soon as another thread calls SignalSemaphore().

Parameters

Semaphore The semaphore to wait for.

Return value

None.

Remarks

The semaphore count is limited to a signed 32-bit value, so a maximum of 2147483647 WaitSemaphore() calls can be made without being balanced by SignalSemaphore() calls in between.

See CreateSemaphore() for a code example.

Supported OS

All

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