Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

MutexObject Class Reference

#include <mutex.h>

Inheritance diagram for MutexObject:

Inheritance graph
[legend]
List of all members.

Detailed Description

Mutex object for thread safe programming.

Author:
Mattias Jansson (mattias@realityrift.com)


Public Member Functions

 MutexObject (const std::string &rstrMutexName="_noname")
virtual ~MutexObject ()
void Lock ()
void Unlock ()
void WaitForEvent ()
void BroadcastEvent ()
void SetName (const std::string &rstrName)

Private Attributes

pthread_mutex_t m_kMutex
pthread_cond_t m_kCond
std::string m_strMutexName


Constructor & Destructor Documentation

MutexObject const std::string &  rstrMutexName = "_noname"  ) 
 

Create a new named mutex object

Parameters:
rstrMutexName Name

virtual ~MutexObject  )  [virtual]
 

Delete mutex object


Member Function Documentation

void Lock  ) 
 

Lock mutex (will block until lock obtained)

void Unlock  ) 
 

Unlock mutex

void WaitForEvent  ) 
 

Block until event occurs

void BroadcastEvent  ) 
 

Broadcast event, wake up all waiting for event

void SetName const std::string &  rstrName  )  [inline]
 

Set mutex name

Parameters:
rstrName New mutex name


Member Data Documentation

pthread_mutex_t m_kMutex [private]
 

Mutex object

pthread_cond_t m_kCond [private]
 

Condition object

std::string m_strMutexName [private]
 

Name


The documentation for this class was generated from the following file:
Generated on Wed Jan 21 14:21:12 2004 for NeoEngine by doxygen 1.3.5