Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

LOW_helper_msglog::msgLock Class Reference

Locking class to ensure exclusive access to output streams. More...

Collaboration diagram for LOW_helper_msglog::msgLock:

Collaboration graph
[legend]
List of all members.

Public Methods

 msgLock ()
 Obtain the lock. More...

 ~msgLock ()
 Release the lock. More...


Static Private Attributes

LOW_thread_mutexmsgMutex = LOW_thread_Factory::new_mutex( LOW_thread_mutex::mutexKind_recursive)
 Recursive mutex used for locking. More...


Detailed Description

Locking class to ensure exclusive access to output streams.

The class is intended to be used in a "locking is creation" design pattern. On creation an exclusive lock is optained, and on destruction the lock is released.

Uses a recursive mutex, i.e. does not distinguish reads/writes but my be called multiple times by the same thread without blocking.

Class is inlined for performance reasons.

See also:
LOW_thread_mutex

Definition at line 142 of file LOW_helper_msglog.h.


Constructor & Destructor Documentation

LOW_helper_msglog::msgLock::msgLock   [inline]
 

Obtain the lock.

Definition at line 146 of file LOW_helper_msglog.h.

References LOW_thread_mutex::lock(), and msgMutex.

LOW_helper_msglog::msgLock::~msgLock   [inline]
 

Release the lock.

Definition at line 153 of file LOW_helper_msglog.h.

References msgMutex, and LOW_thread_mutex::unlock().


Member Data Documentation

LOW_thread_mutex * LOW_helper_msglog::msgLock::msgMutex = LOW_thread_Factory::new_mutex( LOW_thread_mutex::mutexKind_recursive) [static, private]
 

Recursive mutex used for locking.

Definition at line 196 of file LOW_helper_msglog.cpp.

Referenced by msgLock(), and ~msgLock().


The documentation for this class was generated from the following files:
Generated on Mon Nov 10 10:32:47 2003 by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001