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 Member Functions

 msgLock ()
 Obtain the lock.

 ~msgLock ()
 Release the lock.


Static Private Attributes

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


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 143 of file LOW_helper_msglog.h.


Constructor & Destructor Documentation

LOW_helper_msglog::msgLock::msgLock  )  [inline]
 

Obtain the lock.

Definition at line 147 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 154 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 Tue Feb 3 11:30:57 2004 for OneWireLibrary++ by doxygen 1.3.2