25 static void* runThread(
void* arg)
27 return ((
Thread*)arg)->run();
30 Thread::Thread() : m_tid(0), m_running(0), m_detached(0)
37 if (m_running == 1 && m_detached == 0) {
38 pthread_detach(m_tid);
41 pthread_cancel(m_tid);
47 int result = pthread_create(&m_tid, NULL, runThread,
this);
58 result = pthread_join(m_tid, NULL);
69 if (m_running == 1 && m_detached == 0) {
70 result = pthread_detach(m_tid);
78 void Thread::signal(
int signal)
83 pthread_t Thread::self() {