222 void join() {pthread_join(thread, 0);}
247 bool is_caller() {
return pthread_equal(thread, pthread_self());}
310 #ifdef CGU_USE_AUTO_PTR
318 #ifdef CGU_USE_GLIB_MEMORY_SLICES_NO_COMPAT
414 std::unique_ptr<Cgu::Thread::Thread> thread;
523 #ifdef CGU_USE_AUTO_PTR
576 #ifdef CGU_USE_AUTO_PTR
577 JoinableHandle(std::auto_ptr<Cgu::Thread::Thread> thr,
Action act): action(act), detached(false), thread(thr.release()) {}
611 #ifdef CGU_USE_AUTO_PTR
708 static int block(
int& old_state) {
return pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old_state);}
736 static int unblock(
int& old_state) {
return pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &old_state);}
762 int restore(
int& old_state) {
return pthread_setcancelstate(starting_state, &old_state);}
int restore()
Definition: thread.h:771
Action
Definition: thread.h:408
bool is_caller()
Definition: thread.h:247
CancelBlock & operator=(const CancelBlock &)=delete
void cancel()
Definition: thread.h:210
JoinableHandle(std::unique_ptr< Cgu::Thread::Thread > thr, Action act)
Definition: thread.h:579
This file provides classes for type erasure.
A class wrapping a Thread::Thread object representing a joinable thread.
Definition: thread.h:406
void join()
Definition: thread.h:222
int restore(int &old_state)
Definition: thread.h:762
A class enabling the cancellation state of a thread to be controlled.
Definition: thread.h:681
A class which can be thrown to terminate the throwing thread.
Definition: thread.h:813
static int block()
Definition: thread.h:719
A wrapper class for pthread mutexes.
Definition: mutex.h:117
~CancelBlock()
Definition: thread.h:787
CancelBlock(const CancelBlock &)=delete
A class representing a pthread thread.
Definition: thread.h:166
Provides wrapper classes for pthread mutexes and condition variables, and scoped locking classes for ...
Definition: application.h:44
static int block(int &old_state)
Definition: thread.h:708
JoinableHandle(JoinableHandle &&h)
Definition: thread.h:614
static int unblock(int &old_state)
Definition: thread.h:736
Thread & operator=(const Thread &)=delete
void detach()
Definition: thread.h:231
JoinableHandle()
Definition: thread.h:627
static int unblock()
Definition: thread.h:748
static std::unique_ptr< Cgu::Thread::Thread > start(const Cgu::Callback::Callback *cb, bool joinable)
JoinableHandle & operator=(JoinableHandle &&h)
The callback interface class.
Definition: callback.h:522
#define CGU_GLIB_MEMORY_SLICES_FUNCS
Definition: cgu_config.h:84