• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kviewshell

GMonitorLock Class Reference

Wrapper for mutually exclusive code. More...

#include <GThreads.h>

List of all members.


Public Member Functions

 GMonitorLock (GMonitor *gsec)
 ~GMonitorLock ()

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 478 of file GThreads.h.


Constructor & Destructor Documentation

GMonitorLock::GMonitorLock ( GMonitor *  gsec  )  [inline]

Constructor.

Enters the monitor gsec#.

Definition at line 484 of file GThreads.h.

GMonitorLock::~GMonitorLock (  )  [inline]

Destructor.

Leaves the associated monitor.

Definition at line 487 of file GThreads.h.


The documentation for this class was generated from the following file:
  • GThreads.h

kviewshell

Skip menu "kviewshell"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • kviewshell
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal