Developer Documentation
RAVL, Recognition And Vision Library
USER HOME PAGE CLASS LIST CONTENTS
Ravl - OS - Threads - MutexLockC
 

  PUBLIC
MutexLockC::MutexLockC(MutexC &)
MutexLockC::MutexLockC(const MutexC &)
MutexLockC::MutexLockC(const MutexC &,bool)
MutexLockC::~MutexLockC(void)
MutexLockC::Unlock(void)
MutexLockC::Lock(void)
MutexLockC::IsLocked(void) const

   MutexLockC   
 
Exception safe MutexC locking class.
 
include "Ravl/Threads/Mutex.hh"
Created:02/07/1999 
Source file:Ravl/OS/Threads/Posix/Mutex.hh
User Level:Normal
Library:RavlThreads
In Scope:RavlN

Comments:
SMALL OBJECT

The destructor of this object removed the lock if it is held. This ensures whenever the lock goes out of scope, either by returning from the function or if an exception is held, that the lock will be released properly.

It is the users responsability to ensure that the MutexC remains valid for the lifetime of any MutexLockC instance.

Variables:
MutexC & mutex;

bool locked;

Methods:
MutexLockC(MutexC & m)
Create a lock on a mutex.

MutexLockC(const MutexC & m)
Create a lock on a mutex.
This may not seem like a good idea, but it allows otherwise constant functions to lock out other accesses to data without undue faffing.

MutexLockC(const MutexC & m,bool tryLock)
Try and create a lock on a mutex.
This may not seem like a good idea, but it allows otherwise constant functions to lock out other accesses to data without undue faffing.

~MutexLockC()
Create a lock on a mutex.

void Unlock()
Unlock the mutex.

void Lock()
re Lock the mutex.

bool IsLocked() const
Is it locked ?


Maintainer:Charles Galambos, Created: 02/07/1999, Documentation by CxxDoc: Tue Aug 13 09:59:30 2002