RDK Documentation (Open Sourced RDK Components)
CCEC_OSAL::ConditionVariable Class Reference

#include <ConditionVariable.hpp>

Collaboration diagram for CCEC_OSAL::ConditionVariable:
Collaboration graph

Public Member Functions

 ConditionVariable (void)
 Constructor. Creates a ConditionVariable object. More...
 
 ~ConditionVariable (void)
 Destructor. Destroys the ConditionVariable object. More...
 
void set (void)
 sets the condition. Sets the condition assosiated with the ConditionVariable object. More...
 
void reset (void)
 resets the condition. Resets the condition assosiated with the ConditionVariable object to default (false). More...
 
bool isSet (void)
 Checks the status of the condition. Returns the status of the condition associated. Could be true/false. More...
 
void wait (void)
 Wait until the conditional variable is signalled. Causes the current thread to wait until it is signalled or interrupted. Calling thread will wait undefinetly until some other thread signals the ConditionVariable by calling notify/notifyAll.
 
long wait (long timeout)
 Wait until the conditional variable is signalled. Causes the current thread to wait until it is signalled or interrupted . Calling thread will wait undefinetly until some other thread signals the ConditionVariable by calling notify/notifyAll.
 
void notify (void)
 
void notifyAll (void)
 
void * getNativeHandle (void)
 

Private Member Functions

 ConditionVariable (const ConditionVariable &)
 
ConditionVariableoperator= (const ConditionVariable &)
 

Private Attributes

Conditioncond
 
Mutexmutex
 
void * nativeHandle
 

yes

ConditionVariable factors out the Object monitor methods (wait, notify and notifyAll) into distinct objects to give the effect of having multiple wait-sets per object, by combining them with the use of arbitrary Lock implementations.

ConditionVariables provide a means for one thread to suspend execution (to "wait") until notified by another thread that some state condition may now be true. Because access to this shared state information occurs in different threads, it must be protected, so a lock of some form is associated with the condition. The key property that waiting for a condition provides is that it atomically releases the associated lock and suspends the current thread.

A ConditionVariable instance is intrinsically bound to a lock.

Definition at line 65 of file ConditionVariable.hpp.

Constructor & Destructor Documentation

◆ ConditionVariable()

CCEC_OSAL::ConditionVariable::ConditionVariable ( void  )

Constructor. Creates a ConditionVariable object.


The documentation for this class was generated from the following files: