CountingSemaphore Class Reference
#include <CountingSemaphore.h>
Inheritance diagram for CountingSemaphore:
Public Member Functions | |
CountingSemaphore (int initialCount=0) | |
virtual | ~CountingSemaphore () |
Destroy the CountingSemaphore. | |
void | wait () |
bool | tryWait (unsigned long timeout) |
void | post () |
virtual int | count () |
virtual bool | tryAcquire (unsigned long timeout) |
virtual void | acquire () |
virtual void | release () |
Detailed Description
- Author:
- Eric Crahen <http://www.code-foo.com>
- Date:
- <2003-07-16T15:26:18-0400>
- Version:
- 2.2.1
It differs from a normal Semaphore in that there is no upper bound on the count and it will not throw an exception because a maximum value has been exceeded.
- See also:
- Semaphore
Constructor & Destructor Documentation
|
Create a new CountingSemaphore.
|
Member Function Documentation
|
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.
|
|
Provided to reflect the traditional Semaphore semantics
|
|
Increment the count, unblocking one thread if count is positive.
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. |
|
Provided to reflect the traditional Semaphore semantics
|
|
Provided to reflect the traditional Semaphore semantics
|
The documentation for this class was generated from the following file:
- CountingSemaphore.h