67 virtual const char*
what()
const throw() {
return "Thread::CondError";}
75 #ifndef DOXYGEN_PARSING
76 struct CondSetClockError:
public std::exception {
77 virtual const char* what()
const throw() {
return "Thread::CondSetClockError";}
82 virtual const char*
what()
const throw() {
return "Thread::MutexError";}
86 virtual const char*
what()
const throw() {
return "Thread::RecMutexError";}
118 pthread_mutex_t pthr_mutex;
147 int lock() noexcept {
return pthread_mutex_lock(&pthr_mutex);}
157 int trylock() noexcept {
return pthread_mutex_trylock(&pthr_mutex);}
170 int unlock() noexcept {
return pthread_mutex_unlock(&pthr_mutex);}
187 ~Mutex() {pthread_mutex_destroy(&pthr_mutex);}
189 #ifdef CGU_USE_GLIB_MEMORY_SLICES_NO_COMPAT
363 int lock() noexcept {
int ret = mutex.
lock();
if (!owner) owner = !ret;
return ret;}
376 int trylock() noexcept {
int ret = mutex.
trylock();
if (!owner) owner = !ret;
return ret;}
391 int unlock() noexcept {
int ret = mutex.
unlock();
if (owner) owner = ret;
return ret;}
472 int signal() noexcept {
return pthread_cond_signal(&cond);}
483 int broadcast() noexcept {
return pthread_cond_broadcast(&cond);}
513 int wait(
Mutex& mutex) {
return pthread_cond_wait(&cond, &mutex.pthr_mutex);}
579 return pthread_cond_timedwait(&cond, &mutex.pthr_mutex, &abs_time);
594 const timespec& abs_time) {
return timed_wait(lock.mutex, abs_time);}
608 const timespec& abs_time) {
return timed_wait(lock.mutex, abs_time);}
625 static void get_abs_time(timespec& ts,
unsigned int millisec);
663 ~Cond(
void) {pthread_cond_destroy(&cond);}
703 pthread_mutex_t pthr_mutex;
733 int lock() noexcept {
return pthread_mutex_lock(&pthr_mutex);}
750 int trylock() noexcept {
return pthread_mutex_trylock(&pthr_mutex);}
765 int unlock() noexcept {
return pthread_mutex_unlock(&pthr_mutex);}
1013 int lock() noexcept {
int ret = mutex.
lock();
if (!owner) owner = !ret;
return ret;}
1035 int trylock() noexcept {
int ret = mutex.
trylock();
if (!owner) owner = !ret;
return ret;}
1052 int unlock() noexcept {
int ret = mutex.
unlock();
if (owner) owner = ret;
return ret;}
1128 GStaticRecMutex& mutex;
1146 GStaticRecMutex*
get()
const noexcept {
return &mutex;}
int lock() noexcept
Definition: mutex.h:147
int trylock() noexcept
Definition: mutex.h:376
RecMutex::Lock & operator=(const RecMutex::Lock &)=delete
virtual const char * what() const
Definition: mutex.h:82
int trylock() noexcept
Definition: mutex.h:889
int timed_wait(Mutex::Lock &lock, const timespec &abs_time)
Definition: mutex.h:593
Mutex & operator=(const Mutex &)=delete
Lock(Mutex &mutex_) noexcept
Definition: mutex.h:284
virtual const char * what() const
Definition: mutex.h:86
A scoped locking class for exception safe RecMutex locking which tracks the status of its mutex...
Definition: mutex.h:979
static int test_support()
int unlock() noexcept
Definition: mutex.h:170
int trylock() noexcept
Definition: mutex.h:255
TrackLock(RecMutex &mutex_, DeferLock tag) noexcept
Definition: mutex.h:1091
A wrapper class for pthread condition variables.
Definition: mutex.h:449
int unlock() noexcept
Definition: mutex.h:277
int lock() noexcept
Definition: mutex.h:866
int trylock() noexcept
Definition: mutex.h:1035
Lock(Mutex &mutex_, Locked tag) noexcept
Definition: mutex.h:293
~Lock()
Definition: mutex.h:305
~TrackLock()
Definition: mutex.h:1105
A scoped locking class for exception safe RecMutex locking.
Definition: mutex.h:832
int timed_wait(Mutex::TrackLock &lock, const timespec &abs_time)
Definition: mutex.h:607
TrackLock(Mutex &mutex_, DeferLock tag) noexcept
Definition: mutex.h:424
static void get_abs_time(timespec &ts, unsigned int millisec)
static bool have_monotonic_clock()
TrackLock(Mutex &mutex_) noexcept
Definition: mutex.h:406
int lock() noexcept
Definition: mutex.h:1013
RecMutex::TrackLock & operator=(const RecMutex::TrackLock &)=delete
A scoped locking class for exception safe Mutex locking.
Definition: mutex.h:207
Mutex::Lock & operator=(const Mutex::Lock &)=delete
~TrackLock()
Definition: mutex.h:436
Lock(RecMutex &mutex_)
Definition: mutex.h:929
int trylock() noexcept
Definition: mutex.h:157
int timed_wait(Mutex &mutex, const timespec &abs_time)
Definition: mutex.h:578
A wrapper class for pthread mutexes.
Definition: mutex.h:117
TrackLock(RecMutex &mutex_)
Definition: mutex.h:1073
GrecmutexLock & operator=(const GrecmutexLock &)=delete
bool is_owner() const noexcept
Definition: mutex.h:1060
Mutex()
Definition: mutex.h:179
Definition: application.h:44
TrackLock(Mutex &mutex_, Locked tag) noexcept
Definition: mutex.h:415
int unlock() noexcept
Definition: mutex.h:916
A scoped locking class for exception safe Mutex locking which tracks the status of its mutex...
Definition: mutex.h:331
bool is_owner() const noexcept
Definition: mutex.h:399
int trylock() noexcept
Definition: mutex.h:750
Locked
Definition: mutex.h:196
DeferLock
Definition: mutex.h:199
int unlock() noexcept
Definition: mutex.h:1052
A scoped locking class for exception safe locking of GStaticRecMutex objects.
Definition: mutex.h:1127
int signal() noexcept
Definition: mutex.h:472
int wait(Mutex::TrackLock &lock)
Definition: mutex.h:537
int broadcast() noexcept
Definition: mutex.h:483
~Cond(void)
Definition: mutex.h:663
RecMutex & operator=(const RecMutex &)=delete
A wrapper class for pthread mutexes which provides a recursive mutex.
Definition: mutex.h:702
~RecMutex()
Definition: mutex.h:819
Mutex::TrackLock & operator=(const Mutex::TrackLock &)=delete
virtual const char * what() const
Definition: mutex.h:67
TrackLock(RecMutex &mutex_, Locked tag) noexcept
Definition: mutex.h:1082
Lock(RecMutex &mutex_, Locked tag) noexcept
Definition: mutex.h:938
int lock() noexcept
Definition: mutex.h:240
int unlock() noexcept
Definition: mutex.h:765
int unlock() noexcept
Definition: mutex.h:391
int lock() noexcept
Definition: mutex.h:733
int wait(Mutex::Lock &lock)
Definition: mutex.h:525
#define CGU_GLIB_MEMORY_SLICES_FUNCS
Definition: cgu_config.h:84
Cond & operator=(const Cond &)=delete
~Mutex()
Definition: mutex.h:187
int lock() noexcept
Definition: mutex.h:363
GrecmutexLock(GStaticRecMutex &mutex_, Locked tag)
Definition: mutex.h:1165
~Lock()
Definition: mutex.h:951
int wait(Mutex &mutex)
Definition: mutex.h:513