12 #ifndef ROOT_TVirtualMutex 13 #define ROOT_TVirtualMutex 79 : fMutex(mutex) {
if (fMutex) fMutex->
Lock(); }
81 if (!fMutex)
return 0;
92 #if defined (_REENTRANT) || defined (WIN32) 94 #define R__LOCKGUARD(mutex) TLockGuard _R__UNIQUE_(R__guard)(mutex) 95 #define R__LOCKGUARD2(mutex) \ 96 if (gGlobalMutex && !mutex) { \ 97 gGlobalMutex->Lock(); \ 99 mutex = gGlobalMutex->Factory(kTRUE); \ 100 gGlobalMutex->UnLock(); \ 103 #define R__LOCKGUARD_NAMED(name,mutex) TLockGuard _NAME2_(R__guard,name)(mutex) 104 #define R__LOCKGUARD_UNLOCK(name) _NAME2_(R__guard,name).UnLock() 106 #define R__LOCKGUARD(mutex) (void)(mutex); { } 107 #define R__LOCKGUARD_NAMED(name,mutex) (void)(mutex); { } 108 #define R__LOCKGUARD2(mutex) (void)(mutex); { } 109 #define R__LOCKGUARD_UNLOCK(name) { } 113 #define R__LOCKGUARD_IMT(mutex) R__LOCKGUARD(ROOT::Internal::IsParBranchProcessingEnabled() ? mutex : nullptr) 114 #define R__LOCKGUARD_IMT2(mutex) \ 115 if (gGlobalMutex && !mutex && ROOT::Internal::IsParBranchProcessingEnabled()) { \ 116 gGlobalMutex->Lock(); \ 118 mutex = gGlobalMutex->Factory(kTRUE); \ 119 gGlobalMutex->UnLock(); \ 121 R__LOCKGUARD_IMT(mutex) 123 #define R__LOCKGUARD_IMT(mutex) { } 124 #define R__LOCKGUARD_IMT2(mutex) { } 128 #define R__RWLOCK_ACQUIRE_READ(rwlock) if (ROOT::Internal::IsParTreeProcessingEnabled()) rwlock.ReadLock(); 129 #define R__RWLOCK_RELEASE_READ(rwlock) if (ROOT::Internal::IsParTreeProcessingEnabled()) rwlock.ReadUnLock(); 130 #define R__RWLOCK_ACQUIRE_WRITE(rwlock) if (ROOT::Internal::IsParTreeProcessingEnabled()) rwlock.WriteLock(); 131 #define R__RWLOCK_RELEASE_WRITE(rwlock) if (ROOT::Internal::IsParTreeProcessingEnabled()) rwlock.WriteUnLock(); 133 #define R__RWLOCK_ACQUIRE_READ(rwlock) { } 134 #define R__RWLOCK_RELEASE_READ(rwlock) { } 135 #define R__RWLOCK_ACQUIRE_WRITE(rwlock) { } 136 #define R__RWLOCK_RELEASE_WRITE(rwlock) { } virtual TVirtualMutex * Factory(Bool_t=kFALSE)=0
virtual Int_t TryLock()=0
This class implements a mutex interface.
#define ClassDef(name, id)
R__EXTERN TVirtualMutex * gGlobalMutex
TLockGuard(TVirtualMutex *mutex)
#define ClassDefNV(name, id)
TVirtualMutex(Bool_t=kFALSE)
Binding & operator=(OUT(*fun)(void))
virtual Int_t CleanUp()=0