Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::TReentrantRWLock< MutexT, RecurseCountsT > Class Template Reference

template<typename MutexT = ROOT::TSpinMutex, typename RecurseCountsT = Internal::RecurseCounts>
class ROOT::TReentrantRWLock< MutexT, RecurseCountsT >

Definition at line 279 of file TReentrantRWLock.hxx.

Public Types

using State = TVirtualRWMutex::State
 
using StateDelta = TVirtualRWMutex::StateDelta
 

Public Member Functions

 TReentrantRWLock ()
 Regular constructor.
 
void Apply (std::unique_ptr< StateDelta > &&delta)
 Re-apply a delta.
 
std::unique_ptr< StateGetStateBefore ()
 Get the lock state before the most recent write lock was taken.
 
TVirtualRWMutex::Hint_t * ReadLock ()
 Acquire the lock in read mode.
 
void ReadUnLock (TVirtualRWMutex::Hint_t *)
 Release the lock in read mode.
 
std::unique_ptr< StateDeltaRewind (const State &earlierState)
 Rewind to an earlier mutex state, returning the delta.
 
TVirtualRWMutex::Hint_t * WriteLock ()
 Acquire the lock in write mode.
 
void WriteUnLock (TVirtualRWMutex::Hint_t *)
 Release the lock in write mode.
 

Private Member Functions

void AssertReadCountLocIsFromCurrentThread (const size_t *presumedLocalReadersCount)
 Assert that presumedLocalReadersCount really matches the local read count.
 

Private Attributes

std::condition_variable_any fCond
 ! RWlock internal condition variable
 
MutexT fMutex
 ! RWlock internal mutex
 
std::atomic< intfReaderReservation
 ! A reader wants access
 
std::atomic< intfReaders
 ! Number of readers
 
RecurseCountsT fRecurseCounts
 ! Trackers for re-entry in the lock by the same thread.
 
std::atomic< boolfWriter
 ! Is there a writer?
 
std::atomic< intfWriterReservation
 ! A writer wants access
 

#include </home/sftnight/build/workspace/root-makedoc-v632/rootspi/rdoc/src/v6-32-00-patches/core/thread/src/TReentrantRWLock.hxx>

Member Typedef Documentation

◆ State

template<typename MutexT = ROOT::TSpinMutex, typename RecurseCountsT = Internal::RecurseCounts>
using ROOT::TReentrantRWLock< MutexT, RecurseCountsT >::State = TVirtualRWMutex::State

Definition at line 299 of file TReentrantRWLock.hxx.

◆ StateDelta

template<typename MutexT = ROOT::TSpinMutex, typename RecurseCountsT = Internal::RecurseCounts>
using ROOT::TReentrantRWLock< MutexT, RecurseCountsT >::StateDelta = TVirtualRWMutex::StateDelta

Definition at line 300 of file TReentrantRWLock.hxx.

Constructor & Destructor Documentation

◆ TReentrantRWLock()

template<typename MutexT = ROOT::TSpinMutex, typename RecurseCountsT = Internal::RecurseCounts>
ROOT::TReentrantRWLock< MutexT, RecurseCountsT >::TReentrantRWLock ( )
inline

Regular constructor.

Definition at line 304 of file TReentrantRWLock.hxx.

Member Function Documentation

◆ Apply()

template<typename MutexT , typename RecurseCountsT >
void TReentrantRWLock::Apply ( std::unique_ptr< StateDelta > &&  delta)

Re-apply a delta.

Definition at line 358 of file TReentrantRWLock.cxx.

◆ AssertReadCountLocIsFromCurrentThread()

template<typename MutexT , typename RecurseCountsT >
void TReentrantRWLock::AssertReadCountLocIsFromCurrentThread ( const size_t *  presumedLocalReadersCount)
private

Assert that presumedLocalReadersCount really matches the local read count.

Print an error message if not.

Definition at line 394 of file TReentrantRWLock.cxx.

◆ GetStateBefore()

template<typename MutexT , typename RecurseCountsT >
std::unique_ptr< TVirtualRWMutex::State > TReentrantRWLock::GetStateBefore

Get the lock state before the most recent write lock was taken.

Definition at line 260 of file TReentrantRWLock.cxx.

◆ ReadLock()

template<typename MutexT , typename RecurseCountsT >
TVirtualRWMutex::Hint_t * TReentrantRWLock::ReadLock

Acquire the lock in read mode.

Definition at line 70 of file TReentrantRWLock.cxx.

◆ ReadUnLock()

template<typename MutexT , typename RecurseCountsT >
void TReentrantRWLock::ReadUnLock ( TVirtualRWMutex::Hint_t *  hint)

Release the lock in read mode.

Definition at line 137 of file TReentrantRWLock.cxx.

◆ Rewind()

template<typename MutexT , typename RecurseCountsT >
std::unique_ptr< TVirtualRWMutex::StateDelta > TReentrantRWLock::Rewind ( const State earlierState)

Rewind to an earlier mutex state, returning the delta.

Definition at line 300 of file TReentrantRWLock.cxx.

◆ WriteLock()

template<typename MutexT , typename RecurseCountsT >
TVirtualRWMutex::Hint_t * TReentrantRWLock::WriteLock

Acquire the lock in write mode.

Definition at line 169 of file TReentrantRWLock.cxx.

◆ WriteUnLock()

template<typename MutexT , typename RecurseCountsT >
void TReentrantRWLock::WriteUnLock ( TVirtualRWMutex::Hint_t *  )

Release the lock in write mode.

Definition at line 217 of file TReentrantRWLock.cxx.

Member Data Documentation

◆ fCond

template<typename MutexT = ROOT::TSpinMutex, typename RecurseCountsT = Internal::RecurseCounts>
std::condition_variable_any ROOT::TReentrantRWLock< MutexT, RecurseCountsT >::fCond
private

! RWlock internal condition variable

Definition at line 287 of file TReentrantRWLock.hxx.

◆ fMutex

template<typename MutexT = ROOT::TSpinMutex, typename RecurseCountsT = Internal::RecurseCounts>
MutexT ROOT::TReentrantRWLock< MutexT, RecurseCountsT >::fMutex
private

! RWlock internal mutex

Definition at line 286 of file TReentrantRWLock.hxx.

◆ fReaderReservation

template<typename MutexT = ROOT::TSpinMutex, typename RecurseCountsT = Internal::RecurseCounts>
std::atomic<int> ROOT::TReentrantRWLock< MutexT, RecurseCountsT >::fReaderReservation
private

! A reader wants access

Definition at line 283 of file TReentrantRWLock.hxx.

◆ fReaders

template<typename MutexT = ROOT::TSpinMutex, typename RecurseCountsT = Internal::RecurseCounts>
std::atomic<int> ROOT::TReentrantRWLock< MutexT, RecurseCountsT >::fReaders
private

! Number of readers

Definition at line 282 of file TReentrantRWLock.hxx.

◆ fRecurseCounts

template<typename MutexT = ROOT::TSpinMutex, typename RecurseCountsT = Internal::RecurseCounts>
RecurseCountsT ROOT::TReentrantRWLock< MutexT, RecurseCountsT >::fRecurseCounts
private

! Trackers for re-entry in the lock by the same thread.

Definition at line 289 of file TReentrantRWLock.hxx.

◆ fWriter

template<typename MutexT = ROOT::TSpinMutex, typename RecurseCountsT = Internal::RecurseCounts>
std::atomic<bool> ROOT::TReentrantRWLock< MutexT, RecurseCountsT >::fWriter
private

! Is there a writer?

Definition at line 285 of file TReentrantRWLock.hxx.

◆ fWriterReservation

template<typename MutexT = ROOT::TSpinMutex, typename RecurseCountsT = Internal::RecurseCounts>
std::atomic<int> ROOT::TReentrantRWLock< MutexT, RecurseCountsT >::fWriterReservation
private

! A writer wants access

Definition at line 284 of file TReentrantRWLock.hxx.

  • core/thread/src/TReentrantRWLock.hxx
  • core/thread/src/TReentrantRWLock.cxx