ONPOSIX  2.0
 All Classes Namespaces Files Functions Variables Enumerator Friends Macros Pages
PthreadMutexLocker Class Reference

Class to simplify locking and unlocking of pthread mutex. More...

#include <PosixMutex.hpp>

Public Member Functions

 PthreadMutexLocker (pthread_mutex_t &mutex)
 ~PthreadMutexLocker ()

Private Attributes

pthread_mutex_t & mutex_

Detailed Description

Class to simplify locking and unlocking of pthread mutex.

This class has the same purpose of the MutexLocker class but works with pthread mutex type instead of PosixMutex class.

Definition at line 94 of file PosixMutex.hpp.

Constructor & Destructor Documentation

PthreadMutexLocker ( pthread_mutex_t &  mutex)
inline

Definition at line 100 of file PosixMutex.hpp.

: mutex_(mutex) {
pthread_mutex_lock(&mutex_);
}
~PthreadMutexLocker ( )
inline

Definition at line 104 of file PosixMutex.hpp.

{
pthread_mutex_unlock(&mutex_);
}

Member Data Documentation

pthread_mutex_t& mutex_
private

Definition at line 96 of file PosixMutex.hpp.


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