227 void join() {pthread_join(thread, 0);}
252 bool is_caller() {
return pthread_equal(thread, pthread_self());}
315 #ifdef CGU_USE_AUTO_PTR
323 #ifdef CGU_USE_GLIB_MEMORY_SLICES_NO_COMPAT
419 std::unique_ptr<Cgu::Thread::Thread> thread;
528 #ifdef CGU_USE_AUTO_PTR
581 #ifdef CGU_USE_AUTO_PTR
582 JoinableHandle(std::auto_ptr<Cgu::Thread::Thread> thr,
Action act): action(act), detached(false), thread(thr.release()) {}
616 #ifdef CGU_USE_AUTO_PTR
713 static int block(
int& old_state) {
return pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old_state);}
741 static int unblock(
int& old_state) {
return pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &old_state);}
767 int restore(
int& old_state) {
return pthread_setcancelstate(starting_state, &old_state);}
int restore()
Definition: thread.h:776
Action
Definition: thread.h:413
bool is_caller()
Definition: thread.h:252
CancelBlock & operator=(const CancelBlock &)=delete
void cancel()
Definition: thread.h:215
JoinableHandle(std::unique_ptr< Cgu::Thread::Thread > thr, Action act)
Definition: thread.h:584
This file provides classes for type erasure.
A class wrapping a Thread::Thread object representing a joinable thread.
Definition: thread.h:411
void join()
Definition: thread.h:227
int restore(int &old_state)
Definition: thread.h:767
A class enabling the cancellation state of a thread to be controlled.
Definition: thread.h:686
A class which can be thrown to terminate the throwing thread.
Definition: thread.h:818
static int block()
Definition: thread.h:724
A wrapper class for pthread mutexes.
Definition: mutex.h:117
~CancelBlock()
Definition: thread.h:792
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:713
JoinableHandle(JoinableHandle &&h)
Definition: thread.h:619
static int unblock(int &old_state)
Definition: thread.h:741
Thread & operator=(const Thread &)=delete
void detach()
Definition: thread.h:236
JoinableHandle()
Definition: thread.h:632
static int unblock()
Definition: thread.h:753
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