Protium
Math and Design Features
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
Protium::Threads::Mutex Class Reference

Wrapper class for pthreads-style mutexes. More...

#include <Mutex.h>

Public Member Functions

 Mutex ()
 
bool IsLocked ()
 
void Lock ()
 Attempts to lock the mutex and blocks until mutex is available. More...
 
void Unlock ()
 Unlocks the mutex for the next usage. More...
 

Private Member Functions

 Mutex (const Mutex &)
 
Mutexoperator= (const Mutex &)
 

Private Attributes

bool fIsLocked
 
pthread_mutex_t fMtx
 

Detailed Description

Wrapper class for pthreads-style mutexes.

Provides the ability to lock mutexes at the object level

Definition at line 22 of file Mutex.h.

Constructor & Destructor Documentation

Protium::Threads::Mutex::Mutex ( const Mutex )
private
Protium::Threads::Mutex::Mutex ( )

Definition at line 3 of file Mutex.cxx.

Member Function Documentation

bool Protium::Threads::Mutex::IsLocked ( )

Checks to see if the mutex if locked

Returns
True if the mutex is locked elsewhere. False otherwise.

Definition at line 17 of file Mutex.cxx.

void Protium::Threads::Mutex::Lock ( )

Attempts to lock the mutex and blocks until mutex is available.

Definition at line 7 of file Mutex.cxx.

Mutex& Protium::Threads::Mutex::operator= ( const Mutex )
private
void Protium::Threads::Mutex::Unlock ( )

Unlocks the mutex for the next usage.

Definition at line 12 of file Mutex.cxx.

Member Data Documentation

bool Protium::Threads::Mutex::fIsLocked
private

Definition at line 26 of file Mutex.h.

pthread_mutex_t Protium::Threads::Mutex::fMtx
private

Definition at line 25 of file Mutex.h.