MADNESS 0.10.1
madness::PthreadConditionVariable Class Reference

Simple wrapper for Pthread condition variable with its own mutex. More...

#include <worldmutex.h>

Inheritance diagram for madness::PthreadConditionVariable:
Collaboration diagram for madness::PthreadConditionVariable:

Public Member Functions

 PthreadConditionVariable ()
virtual ~PthreadConditionVariable ()
void broadcast () const
pthread_mutex_t & get_pthread_mutex ()
void lock () const
void signal () const
void unlock () const
void wait () const
 You should have acquired the mutex before entering here.

Private Attributes

pthread_cond_t cv
pthread_mutex_t mutex

Additional Inherited Members

Private Member Functions inherited from NO_DEFAULTS
 NO_DEFAULTS ()
 NO_DEFAULTS (const NO_DEFAULTS &)=delete
 NO_DEFAULTS (NO_DEFAULTS &&)=delete
NO_DEFAULTS & operator= (const NO_DEFAULTS &)=delete
NO_DEFAULTS & operator= (NO_DEFAULTS &&)=delete

Detailed Description

Simple wrapper for Pthread condition variable with its own mutex.

Use this when you need to block without consuming cycles. Scheduling granularity is at the level of kernel ticks.

Constructor & Destructor Documentation

◆ PthreadConditionVariable()

madness::PthreadConditionVariable::PthreadConditionVariable ( )
inline

References cv, and mutex.

◆ ~PthreadConditionVariable()

virtual madness::PthreadConditionVariable::~PthreadConditionVariable ( )
inlinevirtual

References cv, and mutex.

Member Function Documentation

◆ broadcast()

void madness::PthreadConditionVariable::broadcast ( ) const
inline

References cv, and MADNESS_EXCEPTION.

◆ get_pthread_mutex()

pthread_mutex_t & madness::PthreadConditionVariable::get_pthread_mutex ( )
inline

References mutex.

◆ lock()

void madness::PthreadConditionVariable::lock ( ) const
inline

◆ signal()

void madness::PthreadConditionVariable::signal ( ) const
inline

◆ unlock()

void madness::PthreadConditionVariable::unlock ( ) const
inline

◆ wait()

void madness::PthreadConditionVariable::wait ( ) const
inline

You should have acquired the mutex before entering here.

References cv, and mutex.

Referenced by madness::DQueue< T >::pop_front(), and madness::DQueue< T >::pop_front().

Member Data Documentation

◆ cv

pthread_cond_t madness::PthreadConditionVariable::cv
mutableprivate

◆ mutex

pthread_mutex_t madness::PthreadConditionVariable::mutex
mutableprivate

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