ROOT
Version master
master
v6.34
v6.32
v6.30
v6.28
v6.26
v6.24
v6.22
v6.20
v6.18
v6.16
v6.14
v6.12
v6.10
v6.08
v6.06
v6.04
Reference Guide
▼
ROOT
ROOT Reference Documentation
Tutorials
►
Functional Parts
►
Namespaces
►
All Classes
▼
Files
▼
File List
►
bindings
▼
core
►
base
►
clingutils
►
cont
►
dictgen
►
foundation
►
gui
►
imt
►
macosx
►
meta
►
metacling
►
multiproc
►
rint
►
testsupport
▼
thread
►
inc
▼
src
►
RConcurrentHashColl.cxx
►
TCondition.cxx
►
TConditionImp.cxx
TMutex.cxx
►
TMutexImp.cxx
►
TPosixCondition.cxx
►
TPosixMutex.cxx
►
TPosixThread.cxx
►
TPosixThreadFactory.cxx
►
TReentrantRWLock.cxx
►
TReentrantRWLock.hxx
►
TRWLock.cxx
TRWMutexImp.cxx
►
TRWMutexImp.h
TRWSpinLock.cxx
TSemaphore.cxx
►
TThread.cxx
►
TThreadFactory.cxx
►
TThreadImp.cxx
TWin32Condition.cxx
►
TWin32Mutex.cxx
►
TWin32Thread.cxx
►
TWin32ThreadFactory.cxx
►
unix
►
winnt
►
zip
►
documentation
►
geom
►
graf2d
►
graf3d
►
gui
►
hist
►
io
►
main
►
master
►
math
►
montecarlo
►
net
►
proof
►
roofit
►
sql
►
tmva
►
tree
►
tutorials
►
File Members
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
TWin32Mutex.cxx
Go to the documentation of this file.
1
// @(#)root/thread:$Id$
2
// Author: Bertrand Bellenot 23/10/04
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
//////////////////////////////////////////////////////////////////////////
13
// //
14
// TWin32Mutex //
15
// //
16
// This class provides an interface to the Win32 mutex routines. //
17
// //
18
//////////////////////////////////////////////////////////////////////////
19
20
#ifndef _WIN32_WINNT
21
#define _WIN32_WINNT 0x0501
// needed for TryEnterCriticalSection
22
#endif
23
24
#include "
TThread.h
"
25
#include "
TWin32Mutex.h
"
26
27
ClassImp
(
TWin32Mutex
);
28
29
////////////////////////////////////////////////////////////////////////////////
30
/// Create a Win32 mutex lock.
31
32
TWin32Mutex::TWin32Mutex
(
Bool_t
recursive
) :
TMutexImp
()
33
{
34
::InitializeCriticalSection
(&
fCritSect
);
35
}
36
37
////////////////////////////////////////////////////////////////////////////////
38
/// TMutex dtor.
39
40
TWin32Mutex::~TWin32Mutex
()
41
{
42
::DeleteCriticalSection
(&
fCritSect
);
43
}
44
45
////////////////////////////////////////////////////////////////////////////////
46
/// Lock the mutex.
47
48
Int_t
TWin32Mutex::Lock
()
49
{
50
::EnterCriticalSection
(&
fCritSect
);
51
return
0;
52
}
53
54
////////////////////////////////////////////////////////////////////////////////
55
/// Try locking the mutex. Returns 0 if mutex can be locked.
56
57
Int_t
TWin32Mutex::TryLock
()
58
{
59
if
(
::TryEnterCriticalSection
(&
fCritSect
))
60
return
0;
61
return
1;
62
}
63
64
////////////////////////////////////////////////////////////////////////////////
65
/// Unlock the mutex.
66
67
Int_t
TWin32Mutex::UnLock
(
void
)
68
{
69
::LeaveCriticalSection
(&
fCritSect
);
70
return
0;
71
}
ClassImp
#define ClassImp(name)
Definition
Rtypes.h:374
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
TThread.h
TWin32Mutex.h
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
TMutexImp
Definition
TMutexImp.h:27
TWin32Mutex
Definition
TWin32Mutex.h:28
TWin32Mutex::Lock
Int_t Lock() override
Lock the mutex.
Definition
TWin32Mutex.cxx:48
TWin32Mutex::UnLock
Int_t UnLock() override
Unlock the mutex.
Definition
TWin32Mutex.cxx:67
TWin32Mutex::~TWin32Mutex
virtual ~TWin32Mutex()
TMutex dtor.
Definition
TWin32Mutex.cxx:40
TWin32Mutex::TWin32Mutex
TWin32Mutex(Bool_t recursive=kFALSE)
Create a Win32 mutex lock.
Definition
TWin32Mutex.cxx:32
TWin32Mutex::TryLock
Int_t TryLock() override
Try locking the mutex. Returns 0 if mutex can be locked.
Definition
TWin32Mutex.cxx:57
TWin32Mutex::fCritSect
CRITICAL_SECTION fCritSect
Definition
TWin32Mutex.h:33
bool
int
core
thread
src
TWin32Mutex.cxx
ROOT master - Reference Guide Generated on Tue Mar 11 2025 15:56:33 (GVA Time) using Doxygen 1.10.0