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

P::RWLock::WriteLock Class Reference
[Core library]

Write Lock class. More...

#include <prwlock.h>

List of all members.

Public Member Functions

 WriteLock (RWLock &lock)
 ~WriteLock ()
WriteLockoperator= (RWLock &mutex)


Detailed Description

Write Lock class.

The lock guard class is used to do exception-safe locking. Simply put a Lock object on the Stack. When the stack-frame is unwinded (by a throw, or a return) the RWLock will be unlocked. The following example shows how to use the Lock guard:

class X {
  void set(int val);
  int get();
  private:
    RWLock rwl;
    int   var;
}

void X::set(int val)
{
  RWLock::WriteLock l(rwl);
  var = val;
}

Definition at line 183 of file prwlock.h.


Constructor & Destructor Documentation

P::RWLock::WriteLock::WriteLock RWLock lock  )  [inline]
 

Definition at line 185 of file prwlock.h.

P::RWLock::WriteLock::~WriteLock  )  [inline]
 

Definition at line 188 of file prwlock.h.


Member Function Documentation

WriteLock& P::RWLock::WriteLock::operator= RWLock mutex  )  [inline]
 

Definition at line 191 of file prwlock.h.

References P::RWLock::writeLock().


The documentation for this class was generated from the following file:
Generated on Fri Mar 12 21:08:35 2004 for P::Classes by doxygen 1.3.3