ULAPI
8.0
|
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 () | |
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.
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.
theLock | A 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.