ULAPI  8.0
Public Member Functions | List of all members
ULScopeLocker Class Reference

ULScopeLocker objects are used to make operations atomic. Just declare a ULScopeLocker object (with a suitable ULLock * parameter) at the top of the function or other block you want made atomic, and the constructor ULScopeLocker object will claim the lock, and its destructor will release the lock whenever control exits the block. See (http://www.cs.wustl.edu/~schmidt/PDF/ScopedLocking.pdf) for details on the Scoped Locking idiom and related concepts.. More...

#include <ulscopelocker.h>

Public Member Functions

 ULScopeLocker (ULLock *theLock)
 
 ~ULScopeLocker ()
 

Detailed Description

ULScopeLocker objects are used to make operations atomic. Just declare a ULScopeLocker object (with a suitable ULLock * parameter) at the top of the function or other block you want made atomic, and the constructor ULScopeLocker object will claim the lock, and its destructor will release the lock whenever control exits the block. See (http://www.cs.wustl.edu/~schmidt/PDF/ScopedLocking.pdf) for details on the Scoped Locking idiom and related concepts..

The UL_LOCKSCOPE macro provides a way of simplifying scope locking via the ULLockable parent class. See ULLockable for details.

Constructor & Destructor Documentation

ULScopeLocker::ULScopeLocker ( ULLock theLock)

If theLock is non-null, this constructor calls theLock->claim() to protect entry into a critical section. The destructor releases the lock.

Parameters
theLockA pointer to the ULLock object that will be claimed by this constructor.
ULScopeLocker::~ULScopeLocker ( )

Exits the critical section entered by the constructor, by releasing the lock that was claimed by the constructor.


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