aboutsummaryrefslogtreecommitdiff
path: root/lib/libc_r/uthread/uthread_sig.c
diff options
context:
space:
mode:
authorJohn Birrell <jb@FreeBSD.org>1998-06-17 22:29:12 +0000
committerJohn Birrell <jb@FreeBSD.org>1998-06-17 22:29:12 +0000
commitb9148b8a3eb9d2e3efe477242462e2012a1ae1a6 (patch)
treece1e49875e9a3eb8e00ef83f30c298fb23ec3cd1 /lib/libc_r/uthread/uthread_sig.c
parenta5211c115d76212cfe9e64f8c05110b421f9f8ab (diff)
downloadsrc-b9148b8a3eb9d2e3efe477242462e2012a1ae1a6.tar.gz
src-b9148b8a3eb9d2e3efe477242462e2012a1ae1a6.zip
Don't allow a SIGCHLD to wake up a thread if the process has the default
signal handler installed for SIGCHLD. The ACE MT_SOCK_Test was hanging as the result of being interrupted when it didn't expect to be.
Notes
Notes: svn path=/head/; revision=37045
Diffstat (limited to 'lib/libc_r/uthread/uthread_sig.c')
-rw-r--r--lib/libc_r/uthread/uthread_sig.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/libc_r/uthread/uthread_sig.c b/lib/libc_r/uthread/uthread_sig.c
index cb323e786500..316b78e93a9b 100644
--- a/lib/libc_r/uthread/uthread_sig.c
+++ b/lib/libc_r/uthread/uthread_sig.c
@@ -292,14 +292,17 @@ _thread_signal(pthread_t pthread, int sig)
case PS_SLEEP_WAIT:
case PS_SIGWAIT:
case PS_SELECT_WAIT:
- /* Flag the operation as interrupted: */
- pthread->interrupted = 1;
+ if (sig != SIGCHLD ||
+ _thread_sigact[sig - 1].sa_handler != SIG_DFL) {
+ /* Flag the operation as interrupted: */
+ pthread->interrupted = 1;
- /* Change the state of the thread to run: */
- PTHREAD_NEW_STATE(pthread,PS_RUNNING);
+ /* Change the state of the thread to run: */
+ PTHREAD_NEW_STATE(pthread,PS_RUNNING);
- /* Return the signal number: */
- pthread->signo = sig;
+ /* Return the signal number: */
+ pthread->signo = sig;
+ }
break;
}
}