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) if (ROOT::Internal::IsParBranchProcessingEnabled()) R__LOCKGUARD(mutex) 114 #define R__LOCKGUARD_IMT2(mutex) if (ROOT::Internal::IsParBranchProcessingEnabled()) R__LOCKGUARD2(mutex) 116 #define R__LOCKGUARD_IMT(mutex) { } 117 #define R__LOCKGUARD_IMT2(mutex) { } 121 #define R__RWLOCK_ACQUIRE_READ(rwlock) if (ROOT::Internal::IsParTreeProcessingEnabled()) rwlock.ReadLock(); 122 #define R__RWLOCK_RELEASE_READ(rwlock) if (ROOT::Internal::IsParTreeProcessingEnabled()) rwlock.ReadUnLock(); 123 #define R__RWLOCK_ACQUIRE_WRITE(rwlock) if (ROOT::Internal::IsParTreeProcessingEnabled()) rwlock.WriteLock(); 124 #define R__RWLOCK_RELEASE_WRITE(rwlock) if (ROOT::Internal::IsParTreeProcessingEnabled()) rwlock.WriteUnLock(); 126 #define R__RWLOCK_ACQUIRE_READ(rwlock) { } 127 #define R__RWLOCK_RELEASE_READ(rwlock) { } 128 #define R__RWLOCK_ACQUIRE_WRITE(rwlock) { } 129 #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