Logo Search packages:      
Sourcecode: djvulibre version File versions  Download package

GMonitorLock Class Reference

#include <GThreads.h>

List of all members.

Detailed Description

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 monitor is released when exiting the protected code. The following code will release the monitor when the execution thread leaves the protected scope, either because the protected code has executed successfully, or because an exception was thrown. {verbatim} { -- protected scope static GMonitor theMonitor; GMonitorLock lock(&theMonitor) ... -- protected code } {verbatim} This construct will do nothing when passed a null pointer.

Definition at line 480 of file GThreads.h.

Public Member Functions

 GMonitorLock (GMonitor *gsec)
 ~GMonitorLock ()

Private Attributes


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

Generated by  Doxygen 1.6.0   Back to index