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

LOW_link::commLock Class Reference

Locking class to ensure exclusive access to a link. More...

#include <LOW_link.h>

Inheritance diagram for LOW_link::commLock:

Inheritance graph
[legend]
Collaboration diagram for LOW_link::commLock:

Collaboration graph
[legend]
List of all members.

Public Methods

 commLock (LOW_link &inLink)
 Obtain the lock. More...

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


Private Attributes

LOW_linklink
 Reference to the link the lock is for. More...


Detailed Description

Locking class to ensure exclusive access to a link.

The class is intended to be used in a "locking is creation" design pattern. On creation an exclusive lock is optained for the device, 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 97 of file LOW_link.h.


Constructor & Destructor Documentation

LOW_link::commLock::commLock LOW_link   inLink [inline]
 

Obtain the lock.

Parameters:
inLink  Reference to the link the lock is for.

Definition at line 102 of file LOW_link.h.

References LOW_link::__linkRecMutex, link, and LOW_thread_mutex::lock().

LOW_link::commLock::~commLock   [inline]
 

Release the lock.

Definition at line 109 of file LOW_link.h.

References LOW_link::__linkRecMutex, link, and LOW_thread_mutex::unlock().


Member Data Documentation

LOW_link& LOW_link::commLock::link [private]
 

Reference to the link the lock is for.

Definition at line 115 of file LOW_link.h.

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


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