13#ifndef ROOT_TRWSpinLock
14#define ROOT_TRWSpinLock
19#include <condition_variable>
29 std::condition_variable_any
fCond;
TRWSpinLockReadGuard(TRWSpinLock &lock)
TRWSpinLockWriteGuard(TRWSpinLock &lock)
TRWSpinLock()
Regular constructor.
void ReadLock()
Acquire the lock in read mode.
std::condition_variable_any fCond
! RWlock internal condition variable
std::atomic< int > fReaderReservation
! A reader wants access
std::atomic< bool > fWriter
! Is there a writer?
void ReadUnLock()
Release the lock in read mode.
ROOT::TSpinMutex fMutex
! RWlock internal mutex
void WriteLock()
Acquire the lock in write mode.
void WriteUnLock()
Release the lock in write mode.
std::atomic< int > fWriterReservation
! A writer wants access
std::atomic< int > fReaders
! Number of readers
A spin mutex class which respects the STL interface for mutexes.