6 Thread::ThreadProc (void *param)
8 Thread *thread = (Thread *) param;
9 int r = mutexLock(thread->mutex);
11 thread->running = false;
12 perror ("ThreadProc:mutexLock");
16 thread->running = false;
18 // this unsuspends a waiting "Kill" below
19 r = mutexUnlock (thread->mutex);
21 perror("ThreadProc:mutexUnlock");
31 int r = threadCreate(p,ThreadProc,this);
34 perror ("Thread::Run:threadCreate");
43 running = false; // signals thread to stop
44 // now wait for clean thread exit (mutex unlock)
50 static void sigquit(int sig) {}
55 void (*ohr)(int sig) = signal(SIGQUIT,sigquit);
56 running = false; // signals thread to stop
57 // now wait for clean thread exit (mutex unlock)
58 threadKill(p); // give it a push