summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjb <jb@FreeBSD.org>1998-06-17 22:29:12 +0000
committerjb <jb@FreeBSD.org>1998-06-17 22:29:12 +0000
commit32f1e04359206dd5adc141c16e5bb8b00a61eb6d (patch)
tree7ba6edd526e8de41aa912313b2790f3ed8ac88e7
parentbd99227578895433ee2d6258c6002c209a36084e (diff)
downloadFreeBSD-src-32f1e04359206dd5adc141c16e5bb8b00a61eb6d.zip
FreeBSD-src-32f1e04359206dd5adc141c16e5bb8b00a61eb6d.tar.gz
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.
-rw-r--r--lib/libc_r/uthread/uthread_sig.c15
-rw-r--r--lib/libkse/thread/thr_sig.c15
-rw-r--r--lib/libpthread/thread/thr_sig.c15
3 files changed, 27 insertions, 18 deletions
diff --git a/lib/libc_r/uthread/uthread_sig.c b/lib/libc_r/uthread/uthread_sig.c
index cb323e7..316b78e 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;
}
}
diff --git a/lib/libkse/thread/thr_sig.c b/lib/libkse/thread/thr_sig.c
index cb323e7..316b78e 100644
--- a/lib/libkse/thread/thr_sig.c
+++ b/lib/libkse/thread/thr_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;
}
}
diff --git a/lib/libpthread/thread/thr_sig.c b/lib/libpthread/thread/thr_sig.c
index cb323e7..316b78e 100644
--- a/lib/libpthread/thread/thr_sig.c
+++ b/lib/libpthread/thread/thr_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;
}
}
OpenPOWER on IntegriCloud