MADNESS 0.10.1
madness::Mutex Class Reference

Mutex using pthread mutex operations. More...

#include <worldmutex.h>

Inheritance diagram for madness::Mutex:

Public Member Functions

 Mutex (int junk=0)
 Make and initialize a mutex ... initial state is unlocked.
virtual ~Mutex ()
void lock () const
 Acquire the mutex waiting if necessary.
pthread_mutex_t * ptr () const
 Return a pointer to the pthread mutex for use by a condition variable.
bool try_lock () const
 Try to acquire the mutex ... return true on success, false on failure.
void unlock () const
 Free a mutex owned by this thread.

Private Member Functions

 Mutex (const Mutex &)
 Copy constructor is forbidden.
void operator= (const Mutex &)
 Assignment is forbidden.

Private Attributes

pthread_mutex_t mutex

Detailed Description

Mutex using pthread mutex operations.

Constructor & Destructor Documentation

◆ Mutex() [1/2]

madness::Mutex::Mutex ( const Mutex & )
private

Copy constructor is forbidden.

References Mutex().

Referenced by Mutex(), and operator=().

◆ Mutex() [2/2]

madness::Mutex::Mutex ( int junk = 0)
inline

Make and initialize a mutex ... initial state is unlocked.

References MADNESS_EXCEPTION, and mutex.

◆ ~Mutex()

virtual madness::Mutex::~Mutex ( )
inlinevirtual

References mutex.

Member Function Documentation

◆ lock()

◆ operator=()

void madness::Mutex::operator= ( const Mutex & )
private

Assignment is forbidden.

References Mutex().

◆ ptr()

pthread_mutex_t * madness::Mutex::ptr ( ) const
inline

Return a pointer to the pthread mutex for use by a condition variable.

References mutex.

◆ try_lock()

bool madness::Mutex::try_lock ( ) const
inline

Try to acquire the mutex ... return true on success, false on failure.

References mutex.

Referenced by madness::WorldAmInterface::free_managed_buffers(), madness::WorldAmInterface::send(), and madness::try_two_locks().

◆ unlock()

Member Data Documentation

◆ mutex

pthread_mutex_t madness::Mutex::mutex
mutableprivate

Referenced by Mutex(), ~Mutex(), lock(), ptr(), try_lock(), and unlock().


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