IBR-DTNSuite  0.10
ibrcommon::Mutex Class Reference

#include <Mutex.h>

Inheritance diagram for ibrcommon::Mutex:
Inheritance graph
Collaboration diagram for ibrcommon::Mutex:
Collaboration graph

Public Types

enum  MUTEX_TYPE { MUTEX_NORMAL = PTHREAD_MUTEX_NORMAL, MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE, MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK }
 

Public Member Functions

 Mutex (MUTEX_TYPE type=MUTEX_NORMAL)
 
virtual ~Mutex ()
 
virtual void trylock () throw (MutexException)
 
virtual void enter () throw (MutexException)
 
virtual void leave () throw (MutexException)
 
- Public Member Functions inherited from ibrcommon::MutexInterface
virtual ~MutexInterface ()=0
 

Static Public Member Functions

static MutexInterfacedummy ()
 

Protected Attributes

pthread_mutex_t m_mutex
 
pthread_mutexattr_t m_attr
 

Detailed Description

Definition at line 59 of file Mutex.h.

Member Enumeration Documentation

Enumerator
MUTEX_NORMAL 
MUTEX_RECURSIVE 
MUTEX_ERRORCHECK 

Definition at line 62 of file Mutex.h.

Constructor & Destructor Documentation

ibrcommon::Mutex::Mutex ( MUTEX_TYPE  type = MUTEX_NORMAL)

Definition at line 32 of file Mutex.cpp.

References m_attr, and m_mutex.

ibrcommon::Mutex::~Mutex ( )
virtual

Definition at line 39 of file Mutex.cpp.

References m_attr, and m_mutex.

Member Function Documentation

MutexInterface & ibrcommon::Mutex::dummy ( )
static

Definition at line 108 of file Mutex.cpp.

void ibrcommon::Mutex::enter ( ) throw (MutexException)
virtual

Implements ibrcommon::MutexInterface.

Definition at line 60 of file Mutex.cpp.

References m_mutex.

Referenced by dtn::storage::DataStorage::istream::istream().

void ibrcommon::Mutex::leave ( ) throw (MutexException)
virtual

Implements ibrcommon::MutexInterface.

Definition at line 98 of file Mutex.cpp.

References m_mutex.

void ibrcommon::Mutex::trylock ( ) throw (MutexException)
virtual

Implements ibrcommon::MutexInterface.

Definition at line 45 of file Mutex.cpp.

References m_mutex.

Member Data Documentation

pthread_mutexattr_t ibrcommon::Mutex::m_attr
protected

Definition at line 80 of file Mutex.h.

Referenced by Mutex(), and ~Mutex().

pthread_mutex_t ibrcommon::Mutex::m_mutex
protected

Definition at line 79 of file Mutex.h.

Referenced by enter(), leave(), Mutex(), trylock(), and ~Mutex().


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