Logo ROOT  
Reference Guide
 
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
28////////////////////////////////////////////////////////////////////////////////
29/// Create a Win32 mutex lock.
30
35
36////////////////////////////////////////////////////////////////////////////////
37/// TMutex dtor.
38
43
44////////////////////////////////////////////////////////////////////////////////
45/// Lock the mutex.
46
52
53////////////////////////////////////////////////////////////////////////////////
54/// Try locking the mutex. Returns 0 if mutex can be locked.
55
57{
59 return 0;
60 return 1;
61}
62
63////////////////////////////////////////////////////////////////////////////////
64/// Unlock the mutex.
65
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Int_t Lock() override
Lock the mutex.
Int_t UnLock() override
Unlock the mutex.
virtual ~TWin32Mutex()
TMutex dtor.
TWin32Mutex(Bool_t recursive=kFALSE)
Create a Win32 mutex lock.
Int_t TryLock() override
Try locking the mutex. Returns 0 if mutex can be locked.
CRITICAL_SECTION fCritSect
Definition TWin32Mutex.h:33