torque Torque Game Engine Documentation
TGE Version 1.5.2

MutexHandle Class Reference

#include <platformMutex.h>


Detailed Description

Helper for simplifying mutex locking code.

This class will automatically unlock a mutex that you've locked through it, saving you from managing a lot of complex exit cases. For instance:

 MutexHandle handle;
 handle.lock(myMutex);

 if(error1)
   return; // Auto-unlocked by handle if we leave here - normally would
           // leave the mutex locked, causing much pain later.

 handle.unlock();


Public Member Functions

 MutexHandle ()
 ~MutexHandle ()
bool lock (void *mutex, bool blocking=true)
void unlock ()

Private Attributes

voidmMutexPtr


Constructor & Destructor Documentation

MutexHandle::MutexHandle (  )  [inline]

MutexHandle::~MutexHandle (  )  [inline]


Member Function Documentation

bool MutexHandle::lock ( void mutex,
bool  blocking = true 
) [inline]

void MutexHandle::unlock (  )  [inline]


Field Documentation




All Rights Reserved GarageGames.com, Inc. 1999-2005
Auto-magically Generated with Doxygen