MADNESS  0.10.1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
madness::Mutex Class Reference

Mutex using pthread mutex operations. More...

#include <worldmutex.h>

Inheritance diagram for madness::Mutex:
Inheritance graph
[legend]

Public Member Functions

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

Private Member Functions

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

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.

◆ 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()

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

◆ operator=()

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

Assignment is forbidden.

◆ 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()

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

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: