stop thread signal even when no syscall is in progress
+
+ // fixmee.. here we need a better solution to ensure
+ // that the thread context take notice of the signal
+ // even when no syscall is in progress
+ while(!sendSignal(SIGUSR1))
+ {
+ eDebug("send SIGUSR1 to thread context");
+ usleep(5000); // wait msek
+ }
return res; /* 0: thread is guaranteed not to run. 1: state unknown. */
}
return res; /* 0: thread is guaranteed not to run. 1: state unknown. */
}
-void eThread::sendSignal(int sig)
+int eThread::sendSignal(int sig)
- pthread_kill(the_thread, sig);
+ return pthread_kill(the_thread, sig);
else
eDebug("send signal to non running thread");
else
eDebug("send signal to non running thread");
}
void eThread::kill(bool sendcancel)
}
void eThread::kill(bool sendcancel)
/* result: 0 - thread is not alive
1 - thread state unknown */
int sync();
/* result: 0 - thread is not alive
1 - thread state unknown */
int sync();
- void sendSignal(int sig);
+ int sendSignal(int sig);
/* join the thread, i.e. busywait until thread has finnished. */
void kill(bool sendcancel=false);
/* join the thread, i.e. busywait until thread has finnished. */
void kill(bool sendcancel=false);