#include <mrpt/synch/CSemaphore.h>
Public Member Functions | |
CSemaphore (unsigned int initialCount, unsigned int maxCount, const std::string &name=std::string("")) | |
Creates a semaphore. | |
virtual | ~CSemaphore () |
Destructor. | |
bool | waitForSignal (unsigned int timeout_ms=0) |
Blocks until the count of the semaphore to be non-zero. | |
void | release (unsigned int increaseCount=1) |
Increments the count of the semaphore by a given amount. | |
Protected Attributes | |
utils::CReferencedMemBlock | m_data |
The state of a semaphore object is signaled when its count is greater than zero, and nonsignaled when its count is equal to zero. The initialCount parameter specifies the initial count. Each time a waiting thread is released because of the semaphore's signaled state, the count of the semaphore is decreased by one. Use the release function to increment a semaphore's count by a specified amount. The count can never be less than zero or greater than the value specified in the maxCount parameter.
Definition at line 52 of file CSemaphore.h.
mrpt::synch::CSemaphore::CSemaphore | ( | unsigned int | initialCount, | |
unsigned int | maxCount, | |||
const std::string & | name = std::string("") | |||
) |
Creates a semaphore.
virtual mrpt::synch::CSemaphore::~CSemaphore | ( | ) | [virtual] |
Destructor.
void mrpt::synch::CSemaphore::release | ( | unsigned int | increaseCount = 1 |
) |
Increments the count of the semaphore by a given amount.
bool mrpt::synch::CSemaphore::waitForSignal | ( | unsigned int | timeout_ms = 0 |
) |
Blocks until the count of the semaphore to be non-zero.
timeout_ms | The timeout in milliseconds, or set to zero to wait indefinidely. |
Definition at line 55 of file CSemaphore.h.
Page generated by Doxygen 1.5.7.1 for MRPT 0.7.1 SVN: at Mon Aug 17 23:10:56 EDT 2009 |