ROOT
6.07/01
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
Namespaces
All Classes
Files
Release Notes
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
core
base
src
TVirtualMutex.cxx
Go to the documentation of this file.
1
// @(#)root/base:$Id$
2
// Author: Fons Rademakers 14/02/2002
3
4
/*************************************************************************
5
* Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *
6
* All rights reserved. *
7
* *
8
* For the licensing terms see $ROOTSYS/LICENSE. *
9
* For the list of contributors see $ROOTSYS/README/CREDITS. *
10
*************************************************************************/
11
12
/** \class TVirtualMutex
13
14
This class implements a mutex interface. The actual work is done via
15
TMutex which is available as soon as the thread library is loaded.
16
17
and
18
19
TLockGuard
20
21
This class provides mutex resource management in a guaranteed and
22
exception safe way. Use like this:
23
~~~ {.cpp}
24
{
25
TLockGuard guard(mutex);
26
... // do something
27
}
28
~~~
29
when guard goes out of scope the mutex is unlocked in the TLockGuard
30
destructor. The exception mechanism takes care of calling the dtors
31
of local objects so it is exception safe.
32
*/
33
34
#include "
TVirtualMutex.h
"
35
36
ClassImp
(
TVirtualMutex
)
37
ClassImp
(
TLockGuard
)
38
39
// Global mutex set in TThread::Init protecting creation
40
// of other (preferably local) mutexes. Note that in this
41
// concept gGlobalMutex must be used in TStorage to prevent
42
// lockup of the system (see TMutex::Factory)
43
TVirtualMutex
*gGlobalMutex = 0;
TVirtualMutex
This class implements a mutex interface.
Definition:
TVirtualMutex.h:34
TVirtualMutex.h
TLockGuard
Definition:
TVirtualMutex.h:69
ClassImp
ClassImp(TVirtualMutex) ClassImp(TLockGuard) TVirtualMutex *gGlobalMutex=0