#include <CountingSemaphore.h>
Inheritance diagram for CountingSemaphore:
Public Methods | |
CountingSemaphore (int initialCount=0) | |
virtual | ~CountingSemaphore () throw () |
Destroy the CountingSemaphore. | |
void | wait () |
bool | tryWait (unsigned long) |
void | post () |
virtual int | count () throw () |
virtual bool | tryAcquire (unsigned long timeout) |
virtual void | acquire () |
virtual void | release () |
Threads blocked on a CountingSemaphore are resumed in FIFO order.
Error Checking
None. An attempt to increase a CountingSemaphore beyond its maximum value will not result in an InvalidOp_Exception.
|
Create a new CountingSemaphore.
|
|
Decrement the count, blocking that calling thread if the count becomes 0 or less than 0. The calling thread will remain blocked until the count is raised above 0 or if an exception is thrown.
Implements Lockable. |
|
Get the current count of the semaphore. This value may change immediately after this function returns to the calling thread.
|
|
Increment the count.
|
|
Increment the count, unblocking one thread if count is posative.
Implements Lockable. |
|
Decrement the count, blocking that calling thread if the count becomes 0 or less than 0. The calling thread will remain blocked until the count is raised above 0, an exception is thrown or the given amount of time expires.
Implements Lockable. |
|
Decrement the count.
|
|
Decrement the count.
|