Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
Establish a correspondence between a C++ scope and a FXMutex, so that entering and leaving the scope in which the scoped lock is defined will automatically lock and unlock the associated mutex. More...
#include <FXMutex.h>
Public Member Functions | |
FXScopedMutex (FXMutex &m) | |
Construct and lock associated mutex. | |
FXMutex & | mutex () |
Return reference to associated mutex. | |
void | lock () |
Lock mutex. | |
FXbool | trylock () |
Return true if succeeded locking the mutex. | |
FXbool | locked () |
Return true if mutex is already locked. | |
void | unlock () |
Unlock mutex. | |
~FXScopedMutex () | |
Destroy and unlock associated mutex. | |
Establish a correspondence between a C++ scope and a FXMutex, so that entering and leaving the scope in which the scoped lock is defined will automatically lock and unlock the associated mutex.
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 |