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

 commLock (LOW_link &inLink)
 Obtain the lock.

 ~commLock ()
 Release the lock.


Private Attributes

LOW_linklink
 Reference to the link the lock is for.


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 Tue Feb 3 11:30:58 2004 for OneWireLibrary++ by doxygen 1.3.2