Logo ROOT   6.10/09
Reference Guide
TWin32Mutex.h
Go to the documentation of this file.
1 // @(#)root/thread:$Id$
2 // Author: Bertrand Bellenot 20/10/2004
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2004, 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 #ifndef ROOT_TWin32Mutex
13 #define ROOT_TWin32Mutex
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TWin32Mutex //
19 // //
20 // This class provides an interface to the Win32 mutex routines. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TMutexImp.h"
25 
26 #include "Windows4Root.h"
27 
28 #ifdef __CINT__
29 struct CRITICAL_SECTION;
30 #endif
31 
32 class TWin32Mutex : public TMutexImp {
33 
34 friend class TWin32Condition;
35 
36 private:
37  CRITICAL_SECTION fCritSect;
38 
39 public:
40  TWin32Mutex(Bool_t recursive=kFALSE);
41  virtual ~TWin32Mutex();
42 
43  Int_t Lock();
44  Int_t UnLock();
45  Int_t TryLock();
46 
47  ClassDef(TWin32Mutex,0) // Win32 mutex lock
48 };
49 
50 #endif
Int_t UnLock()
Unlock the mutex.
Definition: TWin32Mutex.cxx:67
Int_t Lock()
Lock the mutex.
Definition: TWin32Mutex.cxx:48
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
#define ClassDef(name, id)
Definition: Rtypes.h:297
CRITICAL_SECTION fCritSect
Definition: TWin32Mutex.h:37
TWin32Mutex(Bool_t recursive=kFALSE)
Create a Win32 mutex lock.
Definition: TWin32Mutex.cxx:32
Int_t TryLock()
Try locking the mutex. Returns 0 if mutex can be locked.
Definition: TWin32Mutex.cxx:57
const Bool_t kFALSE
Definition: RtypesCore.h:92
virtual ~TWin32Mutex()
TMutex dtor.
Definition: TWin32Mutex.cxx:40