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";}
110 pthread_mutex_t pthr_mutex;
132 int lock() {
return pthread_mutex_lock(&pthr_mutex);}
142 int trylock() {
return pthread_mutex_trylock(&pthr_mutex);}
155 int unlock() {
return pthread_mutex_unlock(&pthr_mutex);}
172 ~Mutex() {pthread_mutex_destroy(&pthr_mutex);}
174 #ifdef CGU_USE_GLIB_MEMORY_SLICES_NO_COMPAT
330 int lock() {
int ret = mutex.
lock();
if (!owner) owner = !ret;
return ret;}
362 int unlock() {
int ret = mutex.
unlock();
if (owner) owner = ret;
return ret;}
440 int signal() {
return pthread_cond_signal(&cond);}
476 int wait(
Mutex& mutex) {
return pthread_cond_wait(&cond, &mutex.pthr_mutex);}
529 return pthread_cond_timedwait(&cond, &mutex.pthr_mutex, &abs_time);
539 const timespec& abs_time) {
return timed_wait(lock.mutex, abs_time);}
550 const timespec& abs_time) {
return timed_wait(lock.mutex, abs_time);}
567 static void get_abs_time(timespec& ts,
unsigned int millisec);
607 ~Cond(
void) {pthread_cond_destroy(&cond);}
640 pthread_mutex_t pthr_mutex;
663 int lock() {
return pthread_mutex_lock(&pthr_mutex);}
680 int trylock() {
return pthread_mutex_trylock(&pthr_mutex);}
695 int unlock() {
return pthread_mutex_unlock(&pthr_mutex);}
929 int lock() {
int ret = mutex.
lock();
if (!owner) owner = !ret;
return ret;}
972 int unlock() {
int ret = mutex.
unlock();
if (owner) owner = ret;
return ret;}
1037 #ifdef CGU_USE_DIAGNOSTIC_PRAGMAS
1038 #pragma GCC diagnostic push
1039 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
1058 GStaticRecMutex& mutex;
1069 GStaticRecMutex*
get()
const {
return &mutex;}
1110 #ifdef CGU_USE_DIAGNOSTIC_PRAGMAS
1111 #pragma GCC diagnostic pop