Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
Establish a correspondence between a C++ scope and an FXSpinLock, so that entering and leaving the scope in which the scoped lock is defined will automatically lock and unlock the associated spin lock. More...
#include <FXSpinLock.h>
Public Member Functions | |
FXScopedSpinLock (FXSpinLock &s) | |
Construct & lock associated spinlock. | |
FXSpinLock & | spinlock () |
Return reference to associated spinlock. | |
void | lock () |
Lock spinlock. | |
FXbool | trylock () |
Return true if succeeded locking the spinlock. | |
FXbool | locked () |
Return true if spinlock is already locked. | |
void | unlock () |
Unlock spin lock. | |
~FXScopedSpinLock () | |
Destroy and unlock associated spinlock. | |
Establish a correspondence between a C++ scope and an FXSpinLock, so that entering and leaving the scope in which the scoped lock is defined will automatically lock and unlock the associated spin lock.
This will typically result in much less coding, and in addition will make the code safe from exceptions.
Copyright © 1997-2022 Jeroen van der Zijp |