Logo ROOT   6.14/05
Reference Guide
TRWMutexImp.h
Go to the documentation of this file.
1 // Author: Philippe Canal, 2017
2 
3 /*************************************************************************
4  * Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. *
5  * All rights reserved. *
6  * *
7  * For the licensing terms see $ROOTSYS/LICENSE. *
8  * For the list of contributors see $ROOTSYS/README/CREDITS. *
9  *************************************************************************/
10 
11 #ifndef ROOT_TRWMutexImp
12 #define ROOT_TRWMutexImp
13 
14 #include "TVirtualRWMutex.h"
15 #include "ROOT/TSpinMutex.hxx"
17 
18 #include "TBuffer.h" // Needed by ClassDefInlineOverride
19 
20 namespace ROOT {
21 template <typename MutexT, typename RecurseCountsT = ROOT::Internal::RecurseCounts>
22 class TRWMutexImp : public TVirtualRWMutex {
24 
25 public:
26  Hint_t * ReadLock() override;
27  void ReadUnLock(Hint_t *) override;
28  Hint_t * WriteLock() override;
29  void WriteUnLock(Hint_t *) override;
30 
31  TVirtualRWMutex *Factory(Bool_t /*recursive*/ = kFALSE) override;
32  std::unique_ptr<State> GetStateBefore() override;
33  std::unique_ptr<StateDelta> Rewind(const State &earlierState) override;
34  void Apply(std::unique_ptr<StateDelta> &&delta) override;
35 
36  ClassDefInlineOverride(TRWMutexImp,0) // Concrete RW mutex lock class
37 };
38 
39 } // namespace ROOT.
40 
41 #endif
void Apply(std::unique_ptr< StateDelta > &&delta) override
Apply the mutex state delta.
Definition: TRWMutexImp.cxx:95
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
Hint_t * ReadLock() override
Take the Read Lock of the mutex.
Definition: TRWMutexImp.cxx:31
std::unique_ptr< State > GetStateBefore() override
Get the mutex state before the current lock was taken.
bool Bool_t
Definition: RtypesCore.h:59
Hint_t * WriteLock() override
Take the Write Lock of the mutex.
Definition: TRWMutexImp.cxx:40
void ReadUnLock(Hint_t *) override
Release the read lock of the mutex.
Definition: TRWMutexImp.cxx:49
ROOT::TReentrantRWLock< MutexT, RecurseCountsT > fMutexImp
Definition: TRWMutexImp.h:23
#define ClassDefInlineOverride(name, id)
Definition: Rtypes.h:336
const Bool_t kFALSE
Definition: RtypesCore.h:88
void WriteUnLock(Hint_t *) override
Release the read lock of the mutex.
Definition: TRWMutexImp.cxx:58
Earlier lock state as returned by GetState() that can be passed to Restore()
TVirtualRWMutex * Factory(Bool_t=kFALSE) override
Create mutex and return pointer to it.
Definition: TRWMutexImp.cxx:67
std::unique_ptr< StateDelta > Rewind(const State &earlierState) override
Restore the mutex state to state.
Definition: TRWMutexImp.cxx:84