35 pthread_mutexattr_t
attr;
37 rc = pthread_mutexattr_init(&
attr);
40 rc = pthread_mutexattr_settype(&
attr, PTHREAD_MUTEX_RECURSIVE);
44 SysError(
"TPosixMutex",
"pthread_mutex_init error");
46 SysError(
"TPosixMutex",
"pthread_mutexattr_settype error");
48 SysError(
"TPosixMutex",
"pthread_mutex_init error");
50 pthread_mutexattr_destroy(&
attr);
54 int rc = pthread_mutex_init(&
fMutex, 0);
56 SysError(
"TPosixMutex",
"pthread_mutex_init error");
66 int rc = pthread_mutex_destroy(&
fMutex);
68 SysError(
"~TPosixMutex",
"pthread_mutex_destroy error");
76 return pthread_mutex_lock(&
fMutex);
84 return pthread_mutex_trylock(&
fMutex);
92 return pthread_mutex_unlock(&
fMutex);
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t attr
virtual void SysError(const char *method, const char *msgfmt,...) const
Issue system error message.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Int_t UnLock() override
Unlock the mutex.
static constexpr int kIsRecursive
TPosixMutex(Bool_t recursive=kFALSE)
Create a posix mutex lock.
Int_t Lock() override
Lock the mutex.
Int_t TryLock() override
Try locking the mutex. Returns 0 if mutex can be locked.
virtual ~TPosixMutex()
TMutex dtor.