ucc::rwlock::gaurd_reader Class Reference

Gaurd class to apply scope based access locking to objects. More...

#include <thread.h>


Public Member Functions

 gaurd_reader ()
 Create an unitialized instance of gaurd.
 gaurd_reader (void *object)
 Construct a gaurd for a specific object.
 ~gaurd_reader ()
 Release mutex when gaurd falls out of scope.
void set (void *object)
 Set gaurd to mutex lock a new object.
void release (void)
 Prematurely release a gaurd.
void operator= (void *pointer)
 Set gaurd to read lock a new object.


Detailed Description

Gaurd class to apply scope based access locking to objects.

The rwlock is located from the rwlock pool rather than contained in the target object, and the read lock is released when the gaurd object falls out of scope. This is essentially an automation mechanism for mutex::reader.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 535 of file thread.h.


Constructor & Destructor Documentation

ucc::rwlock::gaurd_reader::gaurd_reader (  ) 

Create an unitialized instance of gaurd.

Usually used with a gaurd = operator.

ucc::rwlock::gaurd_reader::gaurd_reader ( void *  object  ) 

Construct a gaurd for a specific object.

Parameters:
object to gaurd.


Member Function Documentation

void ucc::rwlock::gaurd_reader::operator= ( void *  pointer  )  [inline]

Set gaurd to read lock a new object.

If a lock is currently held, it is released.

Parameters:
pointer to object to gaurd.

Definition at line 575 of file thread.h.

void ucc::rwlock::gaurd_reader::set ( void *  object  ) 

Set gaurd to mutex lock a new object.

If a lock is currently held, it is released.

Parameters:
object to gaurd.


The documentation for this class was generated from the following file:

Generated on Mon Jul 27 21:11:23 2009 for UCommon by  doxygen 1.5.9