#include <tnlThread.h>
The semaphore class wraps OS specific semaphore functionality for thread synchronization.
Public Member Functions | |
Semaphore (U32 initialCount=0, U32 maximumCount=1024) | |
Semaphore constructor - initialCount specifies how many wait calls will be let through before an increment is required. | |
~Semaphore () | |
void | wait () |
Thread calling wait will block as long as the semaphore's count is zero. | |
void | increment (U32 count=1) |
Increments the semaphore's internal count. | |
Private Attributes | |
sem_t | mSemaphore |
|
Semaphore constructor - initialCount specifies how many wait calls will be let through before an increment is required.
|
|
|
|
Thread calling wait will block as long as the semaphore's count is zero. If the semaphore is incremented, one of the waiting threads will be awakened and the semaphore will decrement. |
|
Increments the semaphore's internal count. This will wake count threads that are waiting on this semaphore. |
|
|