linux signal
This commit is contained in:
@@ -248,6 +248,10 @@
|
||||
typedef long time_t;
|
||||
#endif
|
||||
|
||||
#ifdef POSIX_SIGNALS
|
||||
# define PIP_INTERRUPT_SIGNAL SIGTERM
|
||||
#endif
|
||||
|
||||
#ifdef LINUX
|
||||
# define environ __environ
|
||||
#endif
|
||||
|
||||
@@ -104,7 +104,8 @@ void pipInitThreadSignals() {
|
||||
sigemptyset(&actions.sa_mask);
|
||||
actions.sa_flags = 0;
|
||||
actions.sa_handler = pipThreadSignalHandler;
|
||||
sigaction(SIGUSR2, &actions, 0);
|
||||
if (sigaction(PIP_INTERRUPT_SIGNAL, &actions, 0) != 0)
|
||||
piCout << "sigaction error:" << errorString();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -608,7 +608,7 @@ void PIThread::interrupt() {
|
||||
QueueUserAPC(winThreadAPC, PRIVATE->thread, 0);
|
||||
#else
|
||||
# ifdef POSIX_SIGNALS
|
||||
pthread_kill(PRIVATE->thread, SIGUSR2);
|
||||
pthread_kill(PRIVATE->thread, PIP_INTERRUPT_SIGNAL);
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user