31 pthread_mutexattr_t
attr;
33 rc = pthread_mutexattr_init(&
attr);
36 rc = pthread_mutexattr_settype(&
attr, PTHREAD_MUTEX_RECURSIVE);
40 SysError(
"TPosixMutex",
"pthread_mutex_init error");
42 SysError(
"TPosixMutex",
"pthread_mutexattr_settype error");
44 SysError(
"TPosixMutex",
"pthread_mutex_init error");
46 pthread_mutexattr_destroy(&
attr);
50 int rc = pthread_mutex_init(&
fMutex,
nullptr);
52 SysError(
"TPosixMutex",
"pthread_mutex_init error");
62 int rc = pthread_mutex_destroy(&
fMutex);
64 SysError(
"~TPosixMutex",
"pthread_mutex_destroy error");
72 return pthread_mutex_lock(&
fMutex);
80 return pthread_mutex_trylock(&
fMutex);
88 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.