Wrapper for mutually exclusive code.
Wrapper for mutually exclusive code.
This class locks a specified critical section (see GCriticalSection)
at construction time and unlocks it at destruction time. It provides a
convenient way to take advantage of the C++ implicit destruction of
automatic variables in order to make sure that the critical section is
unlocked when exiting the protected code. The following code will release
the lock when the execution thread leaves the protected scope, either
because the protected code has executed successfully, or because an
exception was thrown.
{ -- protected scope
static GCriticalSection theSection;
GCriticalSectionLock lock(&theSection)
... -- protected code
}
~GCriticalSectionLock()
Alphabetic index HTML hierarchy of classes or Java