Logo ROOT   6.10/09
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 
39 
40 // Global mutex set in TThread::Init protecting creation
41 // of other (preferably local) mutexes. Note that in this
42 // concept gGlobalMutex must be used in TStorage to prevent
43 // lockup of the system (see TMutex::Factory)
This class implements a mutex interface.
Definition: TVirtualMutex.h:32
TVirtualMutex * gGlobalMutex
#define ClassImp(name)
Definition: Rtypes.h:336