Mixes for Privacy and Anonymity in the Internet
Public Member Functions | Private Attributes | List of all members
CAConditionVariable Class Reference
Inheritance diagram for CAConditionVariable:
CAMutex

Public Member Functions

 CAConditionVariable ()
 
 ~CAConditionVariable ()
 
SINT32 wait ()
 Waits for a signal or for a timeout. More...
 
SINT32 wait (CAMutex &oMutex)
 Very ugly shortly to be deleted, uncommented function! More...
 
SINT32 wait (CAMutex *pMutex)
 Very ugly shortly to be deleted, uncommented function! More...
 
SINT32 wait (UINT32 msTimeout)
 Waits for a signal or for a timeout. More...
 
SINT32 signal ()
 Signals this object. More...
 
SINT32 broadcast ()
 Signals this object. More...
 
- Public Member Functions inherited from CAMutex
 CAMutex ()
 
virtual ~CAMutex ()
 
SINT32 lock ()
 
SINT32 unlock ()
 

Private Attributes

CAMutexm_pMutex
 
CASemaphore * m_pSemaphore
 
UINT32 m_iSleepers
 

Additional Inherited Members

- Protected Attributes inherited from CAMutex
CASemaphore * m_pMutex
 

Constructor & Destructor Documentation

◆ CAConditionVariable()

CAConditionVariable::CAConditionVariable ( )

◆ ~CAConditionVariable()

CAConditionVariable::~CAConditionVariable ( )

References m_pMutex, and m_pSemaphore.

Member Function Documentation

◆ broadcast()

SINT32 CAConditionVariable::broadcast ( )

Signals this object.

All threads waiting on this object will awake. Note: lock() must be called before broadcast() and unlock() must be called if proccessing ends.

References E_SUCCESS, E_UNKNOWN, CAMutex::lock(), m_iSleepers, m_pMutex, m_pSemaphore, and CAMutex::unlock().

Referenced by CAThreadPool::addRequest(), CAThreadPool::destroy(), and CAAccountingDBInterface::releaseConnection().

◆ signal()

SINT32 CAConditionVariable::signal ( )

◆ wait() [1/4]

SINT32 CAConditionVariable::wait ( )

◆ wait() [2/4]

SINT32 CAConditionVariable::wait ( CAMutex oMutex)

Very ugly shortly to be deleted, uncommented function!

References E_SUCCESS, E_UNKNOWN, CAMutex::lock(), m_iSleepers, m_pMutex, CAMutex::m_pMutex, m_pSemaphore, and CAMutex::unlock().

◆ wait() [3/4]

SINT32 CAConditionVariable::wait ( CAMutex pMutex)

Very ugly shortly to be deleted, uncommented function!

References E_SUCCESS, E_UNKNOWN, CAMutex::lock(), m_iSleepers, m_pMutex, CAMutex::m_pMutex, m_pSemaphore, and CAMutex::unlock().

◆ wait() [4/4]

SINT32 CAConditionVariable::wait ( UINT32  msTimeout)

Waits for a signal or for a timeout.

Note: lock() must be called before wait() and unlock() must be called if proccessing ends.

Parameters
msTimeouttimout value in millis seconds
Return values
E_SUCCESSif signaled
E_TIMEDOUTif timout was reached
E_UNKNOWNif an error occured
Todo:
add something better here....

References E_SUCCESS, E_TIMEDOUT, E_UNKNOWN, getcurrentTime(), m_pMutex, and wait().

Member Data Documentation

◆ m_iSleepers

UINT32 CAConditionVariable::m_iSleepers
private

◆ m_pMutex

CAMutex* CAConditionVariable::m_pMutex
private

◆ m_pSemaphore

CASemaphore* CAConditionVariable::m_pSemaphore
private