12 #ifndef ROOT_TVirtualMutex 13 #define ROOT_TVirtualMutex 77 : fMutex(mutex) {
if (fMutex) fMutex->
Lock(); }
79 if (!fMutex)
return 0;
90 #if defined (_REENTRANT) || defined (WIN32) 92 #define R__LOCKGUARD(mutex) TLockGuard _R__UNIQUE_(R__guard)(mutex) 93 #define R__LOCKGUARD2(mutex) \ 94 if (gGlobalMutex && !mutex) { \ 95 gGlobalMutex->Lock(); \ 97 mutex = gGlobalMutex->Factory(kTRUE); \ 98 gGlobalMutex->UnLock(); \ 101 #define R__LOCKGUARD_NAMED(name,mutex) TLockGuard _NAME2_(R__guard,name)(mutex) 102 #define R__LOCKGUARD_UNLOCK(name) _NAME2_(R__guard,name).UnLock() 104 #define R__LOCKGUARD(mutex) if (mutex) { } 105 #define R__LOCKGUARD_NAMED(name,mutex) if (mutex) { } 106 #define R__LOCKGUARD2(mutex) if (mutex) { } 107 #define R__LOCKGUARD_UNLOCK(name) { } 111 #define R__LOCKGUARD_IMT(mutex) if (ROOT::Internal::IsParBranchProcessingEnabled()) R__LOCKGUARD(mutex) 112 #define R__LOCKGUARD_IMT2(mutex) if (ROOT::Internal::IsParBranchProcessingEnabled()) R__LOCKGUARD2(mutex) 114 #define R__LOCKGUARD_IMT(mutex) { } 115 #define R__LOCKGUARD_IMT2(mutex) { } 119 #define R__RWLOCK_ACQUIRE_READ(rwlock) if (ROOT::Internal::IsParTreeProcessingEnabled()) rwlock.ReadLock(); 120 #define R__RWLOCK_RELEASE_READ(rwlock) if (ROOT::Internal::IsParTreeProcessingEnabled()) rwlock.ReadUnLock(); 121 #define R__RWLOCK_ACQUIRE_WRITE(rwlock) if (ROOT::Internal::IsParTreeProcessingEnabled()) rwlock.WriteLock(); 122 #define R__RWLOCK_RELEASE_WRITE(rwlock) if (ROOT::Internal::IsParTreeProcessingEnabled()) rwlock.WriteUnLock(); 124 #define R__RWLOCK_ACQUIRE_READ(rwlock) { } 125 #define R__RWLOCK_RELEASE_READ(rwlock) { } 126 #define R__RWLOCK_ACQUIRE_WRITE(rwlock) { } 127 #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)
TObject & operator=(const TObject &rhs)
TObject assignment operator.
R__EXTERN TVirtualMutex * gGlobalMutex
TLockGuard(TVirtualMutex *mutex)
#define ClassDefNV(name, id)
TVirtualMutex(Bool_t=kFALSE)
Mother of all ROOT objects.
virtual Int_t CleanUp()=0