#include <Condition.hpp>
Public Member Functions | |
Condition () | |
Construct a new Condition object. | |
~Condition () | |
Destroy this Condition object. | |
void | notifyOne () |
Signal one thread that is currently waiting on the Condition object through the wait or timedWait methods. | |
void | notifyAll () |
Signal all threads that are currently waiting on the Condition object. | |
void | wait (NonRecursiveMutexLock &lock) |
Atomically unlock a given mutex and wait for the this Condition object to get signalled. | |
bool | timedWait (NonRecursiveMutexLock &lock, UInt32 sTimeout, UInt32 usTimeout=0) |
Atomically unlock a given mutex and wait for a given amount of time for this Condition object to get signalled. | |
Private Member Functions | |
Condition (const Condition &) | |
Condition & | operator= (const Condition &) |
void | doWait (NonRecursiveMutex &mutex) |
bool | doTimedWait (NonRecursiveMutex &mutex, UInt32 sTimeout, UInt32 usTimeout) |
Private Attributes | |
ConditionVar_t | m_condition |
The thread that signals the Condition object has the option of only letting one waiting thread receive the notification, or all threads.
Definition at line 58 of file Condition.hpp.
|
Construct a new Condition object.
Definition at line 54 of file Condition.cpp. References BLOCXX_THROW, and m_condition. |
|
Destroy this Condition object.
Definition at line 63 of file Condition.cpp. References m_condition. |
|
|
|
Definition at line 95 of file Condition.cpp. References BLOCXX_NAMESPACE::NonRecursiveMutex::conditionPostWait(), BLOCXX_NAMESPACE::NonRecursiveMutex::conditionPreWait(), ETIMEDOUT, m_condition, and state. |
|
Definition at line 84 of file Condition.cpp. References BLOCXX_NAMESPACE::NonRecursiveMutex::conditionPostWait(), BLOCXX_NAMESPACE::NonRecursiveMutex::conditionPreWait(), m_condition, and state. |
|
Signal all threads that are currently waiting on the Condition object. This will cause all threads waiting on a call to 'wait' or timedWait to stop blocking and continue execution. Definition at line 77 of file Condition.cpp. References m_condition. Referenced by BLOCXX_NAMESPACE::ThreadCounter::decThreadCount(), BLOCXX_NAMESPACE::Thread::doneRunning(), BLOCXX_NAMESPACE::RWLocker::doWakeups(), BLOCXX_NAMESPACE::ThreadCounter::setMax(), and BLOCXX_NAMESPACE::Semaphore::signal(). |
|
Signal one thread that is currently waiting on the Condition object through the wait or timedWait methods. All other threads waiting on this object through wait or timedWait will continue to block. Definition at line 70 of file Condition.cpp. References m_condition. Referenced by BLOCXX_NAMESPACE::RWLocker::doWakeups(). |
|
|
|
Atomically unlock a given mutex and wait for a given amount of time for this Condition object to get signalled. The thread execution is suspended and does not consume any CPU time until the Condition object is notified (signalled). The mutex lock must be locked by the calling thread on entrance to wait. Before returning to the calling thread, wait re-acquires the mutex lock. This function should always be called within a while loop that checks the condition.
Definition at line 261 of file Condition.cpp. References BLOCXX_THROW, and BLOCXX_NAMESPACE::NonRecursiveMutexLock::isLocked(). Referenced by BLOCXX_NAMESPACE::Thread::definitiveCancel(), BLOCXX_NAMESPACE::RWLocker::getReadLock(), BLOCXX_NAMESPACE::ThreadCounter::incThreadCount(), BLOCXX_NAMESPACE::Semaphore::timedWait(), and BLOCXX_NAMESPACE::ThreadCounter::waitForAll(). |
|
Atomically unlock a given mutex and wait for the this Condition object to get signalled. The thread execution is suspended and does not consume any CPU time until the Condition object is notified (signalled). The mutex lock must be locked by the calling thread on entrance to wait. Before returning to the calling thread, wait re-acquires the mutex lock. This function should always be called within a while loop that checks the condition.
Definition at line 251 of file Condition.cpp. References BLOCXX_THROW, and BLOCXX_NAMESPACE::NonRecursiveMutexLock::isLocked(). Referenced by BLOCXX_NAMESPACE::Semaphore::wait(). |
|
Definition at line 126 of file Condition.hpp. Referenced by Condition(), doTimedWait(), doWait(), notifyAll(), notifyOne(), and ~Condition(). |