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

  PUBLIC
RWLockHoldC::RWLockHoldC(const RWLockC &,bool,bool)
RWLockHoldC::Unlock(void)
RWLockHoldC::~RWLockHoldC(void)
RWLockHoldC::LockRd(void)
RWLockHoldC::LockWr(void)
RWLockHoldC::IsReadLocked(void) const
RWLockHoldC::IsWriteLocked(void) const

   RWLockHoldC   
 
Exception safe RWLockC locking class.
 
include "Ravl/Threads/RWLock.hh"
Created:02/07/1999 
Source file:Ravl/OS/Threads/Posix/RWLock.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 RWLockC remains valid for the lifetime of any RWLockHoldC instance.

Variables:
RWLockC & rwlock;

bool rLocked;

bool wLocked;

Methods:
RWLockHoldC(const RWLockC & m,bool readOnly = true,bool tryOnly = false)
Create a lock on a rwlock.
This may not seem like a good idea, but it allows otherwise constant functions to lock out other accesses to data without undue faffing.

void Unlock()
Unlock the rwlock.

~RWLockHoldC()
Create a lock on a rwlock.

void LockRd()
relock for read

void LockWr()
relock for write

bool IsReadLocked() const
Test if safe for reading.
This will return true if either a write or read lock is inplace.

bool IsWriteLocked() const
Test if safe for writing.


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