Semaphore Class Reference

#include <Pt/System/Semaphore.h>

Counting semaphore. More...

Inherits NonCopyable.

Public Member Functions

 Semaphore (unsigned int initial=0)
 Construct with initial count.
 ~Semaphore ()
 Destructor.
Semaphorewait ()
 Wait for the semaphore to become signaled.
bool tryWait ()
 Non-blocking wait.
Semaphorepost ()
 Signal the semaphore

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~Semaphore()

~Semaphore ( )

Does not wake waiting threads.