amino::mutex Class Reference

#include <mutex.h>

Inheritance diagram for amino::mutex:

amino::recursive_mutex

List of all members.

Public Types

typedef pthread_mutex_t * native_handle_type

Public Member Functions

 mutex ()
virtual ~mutex ()
void lock ()
bool try_lock ()
void unlock ()
native_handle_type native_handle ()

Protected Member Functions

 mutex (bool recursive)

Protected Attributes

pthread_mutex_t fMutex
pthread_mutexattr_t attr_t

Friends

class condition_variable


Detailed Description

This is a class which implements Mutex. This kind of mutex is not reentrable. If threads try to lock it twice, a deadlock will occur.

Author:
Zhi Gan(ganzhi@gmail.com)

Member Typedef Documentation

typedef pthread_mutex_t* amino::mutex::native_handle_type


Constructor & Destructor Documentation

amino::mutex::mutex ( bool  recursive  )  [inline, protected]

private constructor for initialize a reentrant mutex

amino::mutex::mutex (  )  [inline]

virtual amino::mutex::~mutex (  )  [inline, virtual]


Member Function Documentation

void amino::mutex::lock (  )  [inline]

bool amino::mutex::try_lock (  )  [inline]

Returns:
true if succeed

void amino::mutex::unlock (  )  [inline]

native_handle_type amino::mutex::native_handle (  )  [inline]


Friends And Related Function Documentation

friend class condition_variable [friend]


Member Data Documentation

pthread_mutex_t amino::mutex::fMutex [protected]

pthread_mutexattr_t amino::mutex::attr_t [protected]


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

Generated on Tue Dec 9 13:39:39 2008 for Amino by  doxygen 1.5.6