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.
 
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.

◆ 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: