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);}
508 int wait(
Mutex& mutex) noexcept {
return pthread_cond_wait(&cond, &mutex.pthr_mutex);}
559 return pthread_cond_timedwait(&cond, &mutex.pthr_mutex, &abs_time);
569 const timespec& abs_time) noexcept {
return timed_wait(lock.mutex, abs_time);}
578 const timespec& abs_time) noexcept {
return timed_wait(lock.mutex, abs_time);}
595 static void get_abs_time(timespec& ts,
unsigned int millisec);
633 ~Cond(
void) {pthread_cond_destroy(&cond);}
673 pthread_mutex_t pthr_mutex;
703 int lock() noexcept {
return pthread_mutex_lock(&pthr_mutex);}
720 int trylock() noexcept {
return pthread_mutex_trylock(&pthr_mutex);}
735 int unlock() noexcept {
return pthread_mutex_unlock(&pthr_mutex);}
983 int lock() noexcept {
int ret = mutex.
lock();
if (!owner) owner = !ret;
return ret;}
1005 int trylock() noexcept {
int ret = mutex.
trylock();
if (!owner) owner = !ret;
return ret;}
1022 int unlock() noexcept {
int ret = mutex.
unlock();
if (owner) owner = ret;
return ret;}
1098 GStaticRecMutex& mutex;
1116 GStaticRecMutex*
get()
const noexcept {
return &mutex;}