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

MutexLock Class Reference

#include <mutex.h>

Collaboration diagram for MutexLock:

Collaboration graph
[legend]
List of all members.

Detailed Description

Simple class for automatic locking/unlocking mutex object Makes it easier to manage a mutex lock by automatic lock on creation and unlock on destruction. An example:.

void foo() { MutexLock kLock( &kSomeMutex );

//kSomeMutex is now locked if( someTestThatFails() ) return;

doSomething();

} //The kSomeMutex is automatically unlocked whenever the function returns //since the kLock object is destroyed when it runs out of scope
Author:
Mattias Jansson (mattias@realityrift.com)


Public Member Functions

 MutexLock (MutexObject *pkMutexObject)
virtual ~MutexLock ()

Private Attributes

MutexObjectm_pkMutexObject


Constructor & Destructor Documentation

MutexLock MutexObject pkMutexObject  ) 
 

Lock mutex object

Parameters:
pkMutexObject Mutex object

virtual ~MutexLock  )  [virtual]
 

Unlock mutex object


Member Data Documentation

MutexObject* m_pkMutexObject [private]
 

Mutex object we have locked


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