Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 {
23  ROOT::TReentrantRWLock<MutexT, RecurseCountsT> fMutexImp;
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