#include <Pt/System/Semaphore.h>
Counting semaphore. More...
Inherits NonCopyable.
Public Member Functions | |
| Semaphore (unsigned int initial=0) | |
| Construct with initial count. | |
| ~Semaphore () | |
| Destructor. | |
| Semaphore & | wait () |
| Wait for the semaphore to become signaled. | |
| bool | tryWait () |
| Non-blocking wait. | |
| Semaphore & | post () |
| Signal the semaphore | |
wait() decrements the count when it is positive, or suspends the caller until post() increments it. tryWait() returns false if the count is zero. The destructor does not wake waiters.
| ~Semaphore | ( | ) |
Does not wake waiting threads.