FIX::Mutex Class Reference

Portable implementation of a mutex. More...

`#include <Mutex.h>`

## Public Member Functions

| Mutex ()
| ~Mutex ()
void | lock ()
void | unlock ()

## Private Attributes

pthread_mutex_t | m_mutex
pthread_t | m_threadID
int | m_count

## Detailed Description

Portable implementation of a mutex.

Definition at line 47 of file Mutex.h.

## Constructor & Destructor Documentation

## Mutex()

FIX::Mutex::Mutex | ( |  | ) |

inline

Definition at line 67 of file Mutex.h.

{
#ifdef _MSC_VER
LeaveCriticalSection( &m_mutex );
#else
if ( m_count > 1 )
{ m_count--; return ; }
--m_count;
m_threadID = 0;
pthread_mutex_unlock( &m_mutex );
#endif

## ~Mutex()

FIX::Mutex::~Mutex | ( |  | ) |

inline

Definition at line 82 of file Mutex.h.

:
#ifdef _MSC_VER
CRITICAL_SECTION m_mutex;
#else
pthread_mutex_t m_mutex;
pthread_t m_threadID;

## Member Function Documentation

## lock()

void FIX::Mutex::lock | ( |  | ) |

inline

Definition at line 91 of file Mutex.h.

{
public:
Locker( Mutex& mutex )
: m_mutex( mutex )
{
m_mutex.lock();
}

## unlock()

void FIX::Mutex::unlock | ( |  | ) |

inline

Definition at line 104 of file Mutex.h.

{
m_mutex.unlock();
}
private:
Mutex& m_mutex;
};
class ReverseLocker
{
public:

References FIX::Locker::m_mutex, and unlock().

Referenced by FIX::Locker::Locker(), and unlock().

## Member Data Documentation

## m_count

int FIX::Mutex::m_count

private

Definition at line 124 of file Mutex.h.

## m_mutex

pthread_mutex_t FIX::Mutex::m_mutex

private

Definition at line 122 of file Mutex.h.

## m_threadID

pthread_t FIX::Mutex::m_threadID

private

Definition at line 123 of file Mutex.h.

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

- Mutex.h

FIX::Mutex::Mutex
Mutex()
Definition: Mutex.h:67
FIX::Mutex::m_threadID
pthread_t m_threadID
Definition: Mutex.h:123
FIX::Mutex::m_mutex
pthread_mutex_t m_mutex
Definition: Mutex.h:122
FIX::Mutex::m_count
int m_count
Definition: Mutex.h:124