LRAUV  revA
Mutex Class Reference

A simple pthread Mutex abstraction. More...

#include <Mutex.h>

Public Member Functions

 Mutex ()
 Constructor initializes the mutex. More...
 
int lock ()
 Lock the mutex. More...
 
int unlock ()
 Unlock the mutex. More...
 
bool tryLock ()
 Returns true if able to lock the mutex, false if already locked. More...
 

Private Attributes

pthread_mutex_t mutex_
 The Mutex itself. More...
 

Static Private Attributes

static pthread_mutexattr_t MutexAttr_
 
static bool MutexAttrInitialized_
 

Friends

class ThreadCondition
 

Detailed Description

A simple pthread Mutex abstraction.

Constructor & Destructor Documentation

Mutex::Mutex ( )

Constructor initializes the mutex.

References mutex_, MutexAttr_, and MutexAttrInitialized_.

Member Function Documentation

bool Mutex::tryLock ( )

Returns true if able to lock the mutex, false if already locked.

Returns true if mutex if sucessfully locked. Otherwise return false.

References mutex_.

Referenced by MissionManager::run().

Friends And Related Function Documentation

friend class ThreadCondition
friend

Member Data Documentation

pthread_mutex_t Mutex::mutex_
private
pthread_mutexattr_t Mutex::MutexAttr_
staticprivate

Referenced by Mutex().

bool Mutex::MutexAttrInitialized_
staticprivate

Referenced by Mutex().


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