Logo ROOT  
Reference Guide
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 \ingroup Base
14 
15 This class implements a mutex interface. The actual work is done via
16 TMutex which is available as soon as the thread library is loaded.
17 
18 and
19 
20 TLockGuard
21 
22 This class provides mutex resource management in a guaranteed and
23 exception safe way. Use like this:
24 ~~~ {.cpp}
25 {
26  TLockGuard guard(mutex);
27  ... // do something
28 }
29 ~~~
30 when guard goes out of scope the mutex is unlocked in the TLockGuard
31 destructor. The exception mechanism takes care of calling the dtors
32 of local objects so it is exception safe.
33 */
34 
35 #include "TVirtualMutex.h"
36 #include "TVirtualRWMutex.h"
37 
40 
41 // Global mutex set in TThread::Init protecting creation
42 // of other (preferably local) mutexes. Note that in this
43 // concept gGlobalMutex must be used in TStorage to prevent
44 // lockup of the system (see TMutex::Factory)
46 
47 // From TVirtualRWMutex.h:
TLockGuard
Definition: TVirtualMutex.h:67
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TVirtualRWMutex.h
TVirtualMutex
This class implements a mutex interface.
Definition: TVirtualMutex.h:32
gGlobalMutex
TVirtualMutex * gGlobalMutex
Definition: TVirtualMutex.cxx:45
ROOT::TVirtualRWMutex::StateDelta::~StateDelta
virtual ~StateDelta()
TVirtualMutex.h
ROOT::TVirtualRWMutex::State::~State
virtual ~State()