ucommon::ThreadLock::guard_reader Class Reference

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

#include <thread.h>

Public Member Functions

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

Detailed Description

Guard 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 guard object falls out of scope. This is essentially an automation mechanism for mutex::reader.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 516 of file thread.h.


Constructor & Destructor Documentation

ucommon::ThreadLock::guard_reader::guard_reader (  ) 

Create an unitialized instance of guard.

Usually used with a guard = operator.

ucommon::ThreadLock::guard_reader::guard_reader ( const void *  object  ) 

Construct a guard for a specific object.

Parameters:
object to guard.

Member Function Documentation

void ucommon::ThreadLock::guard_reader::operator= ( const void *  pointer  )  [inline]

Set guard to read lock a new object.

If a lock is currently held, it is released.

Parameters:
pointer to object to guard.

Definition at line 556 of file thread.h.

void ucommon::ThreadLock::guard_reader::set ( const void *  object  ) 

Set guard to mutex lock a new object.

If a lock is currently held, it is released.

Parameters:
object to guard.

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

Generated on 30 Jul 2013 for UCommon by  doxygen 1.6.1