This class is a c++ wrapper in order to use conditional variables. Conditional variables help to synchronize threads when there's a logical condition for the synchronization. More...
#include <ConditionalVariable.h>
Public Member Functions | ||||
ConditionalVariable () | ||||
constructor
| ||||
virtual | ~ConditionalVariable () | |||
destructor | ||||
void | signal () | |||
This method sends a signal to the conditional variable telling it that the thread can continue
| ||||
void | wait (Mutex &mutex) | |||
This method waits until a signal arrives stopping the thread. The mutex passed by argument has to be locked before invoking this method. | ||||
Private Attributes | ||||
pthread_cond_t | condition_ | |||
internal condition representation |
This class is a c++ wrapper in order to use conditional variables. Conditional variables help to synchronize threads when there's a logical condition for the synchronization.
Definition at line 21 of file ConditionalVariable.h.
fesa::ConditionalVariable::ConditionalVariable | ( | ) |
constructor
FesaException |
Definition at line 14 of file ConditionalVariable.cpp.
References condition_, and FesaErrorCreatingConditionalVariable.
fesa::ConditionalVariable::~ConditionalVariable | ( | ) | [virtual] |
void fesa::ConditionalVariable::signal | ( | ) |
This method sends a signal to the conditional variable telling it that the thread can continue
FesaException. |
Definition at line 32 of file ConditionalVariable.cpp.
References condition_, and FesaErrorSignalingConditionalVariable.
Referenced by fesa::NotificationThread::addNotificationEvent(), fesa::RTScheduler::cancel(), fesa::AbstractEventSource::enable(), fesa::ProxyReplyHandler::handleReply(), fesa::RTScheduler::post(), fesa::LocalMsgQueue::postMsg(), and fesa::PersistencyManager::trigger().
void fesa::ConditionalVariable::wait | ( | Mutex & | mutex | ) |
This method waits until a signal arrives stopping the thread. The mutex passed by argument has to be locked before invoking this method.
mutex | to lock |
Definition at line 44 of file ConditionalVariable.cpp.
References condition_, FesaErrorWaitingConditionalVariable, and fesa::AbstractMutex::lock_.
Referenced by fesa::LocalMsgQueue::consumeMsg(), fesa::RTScheduler::run(), fesa::NotificationThread::run(), fesa::PersistencyManager::run(), fesa::ProxyReplyHandler::waitReply(), and fesa::AbstractEventSource::waitTillSourceEnabled().
fesa::ConditionalVariable::condition_ [private] |
internal condition representation
Definition at line 56 of file ConditionalVariable.h.
Referenced by ConditionalVariable(), signal(), wait(), and ~ConditionalVariable().