summaryrefslogtreecommitdiffstats
path: root/lib/libc_r
diff options
context:
space:
mode:
authorjasone <jasone@FreeBSD.org>2000-01-20 04:46:52 +0000
committerjasone <jasone@FreeBSD.org>2000-01-20 04:46:52 +0000
commit3d706405069c7f125b5f99b7c1bc918740b2c426 (patch)
tree33117cde5ed6bd353bb777bf9f01ec6e50ebdd44 /lib/libc_r
parent271b33587d1dec543e4b44ec4200f0262b78b981 (diff)
downloadFreeBSD-src-3d706405069c7f125b5f99b7c1bc918740b2c426.zip
FreeBSD-src-3d706405069c7f125b5f99b7c1bc918740b2c426.tar.gz
Do signal deferral for pthread_kill() as it was done in the old days.
Submitted by: deischen
Diffstat (limited to 'lib/libc_r')
-rw-r--r--lib/libc_r/uthread/pthread_private.h5
-rw-r--r--lib/libc_r/uthread/uthread_kern.c8
-rw-r--r--lib/libc_r/uthread/uthread_sig.c23
3 files changed, 6 insertions, 30 deletions
diff --git a/lib/libc_r/uthread/pthread_private.h b/lib/libc_r/uthread/pthread_private.h
index 8bc2d3f..560ea44 100644
--- a/lib/libc_r/uthread/pthread_private.h
+++ b/lib/libc_r/uthread/pthread_private.h
@@ -572,11 +572,6 @@ struct pthread {
sigset_t sigmask;
sigset_t sigpend;
-#ifndef _NO_UNDISPATCH
- /* Non-zero if there are undispatched signals for this thread. */
- int undispatched_signals;
-#endif
-
/* Thread state: */
enum pthread_state state;
enum pthread_state oldstate;
diff --git a/lib/libc_r/uthread/uthread_kern.c b/lib/libc_r/uthread/uthread_kern.c
index b833061..3e0ff17 100644
--- a/lib/libc_r/uthread/uthread_kern.c
+++ b/lib/libc_r/uthread/uthread_kern.c
@@ -39,7 +39,9 @@
#include <string.h>
#include <unistd.h>
#include <setjmp.h>
+#include <sys/param.h>
#include <sys/types.h>
+#include <sys/signalvar.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/socket.h>
@@ -122,16 +124,12 @@ __asm__("fnsave %0": :"m"(*fdata));
pthread_testcancel();
}
-#ifndef _NO_UNDISPATCH
/*
* Check for undispatched signals due to calls to
* pthread_kill().
*/
- if (_thread_run->undispatched_signals != 0) {
- _thread_run->undispatched_signals = 0;
+ if (SIGNOTEMPTY(_thread_run->sigpend))
_dispatch_signals();
- }
-#endif
if (_sched_switch_hook != NULL) {
/* Run the installed switch hook: */
diff --git a/lib/libc_r/uthread/uthread_sig.c b/lib/libc_r/uthread/uthread_sig.c
index 0f18477..dc6d209 100644
--- a/lib/libc_r/uthread/uthread_sig.c
+++ b/lib/libc_r/uthread/uthread_sig.c
@@ -628,27 +628,10 @@ _thread_sig_send(pthread_t pthread, int sig)
!sigismember(&pthread->sigmask, sig)) {
/* Perform any state changes due to signal arrival: */
thread_sig_check_state(pthread, sig);
-
-#ifndef _NO_UNDISPATCH
- if (_thread_run != pthread) {
- /*
- * Make a note to call the signal handler once
- * the signaled thread is running. This is
- * necessary in order to make sure that the
- * signal is delivered on the correct stack.
- */
- pthread->undispatched_signals++;
- } else {
-#endif
- /* Call the installed signal handler. */
- _thread_sig_deliver(pthread, sig);
-#ifndef _NO_UNDISPATCH
- }
-#endif
- } else {
- /* Increment the pending signal count. */
- sigaddset(&pthread->sigpend,sig);
}
+
+ /* Increment the pending signal count. */
+ sigaddset(&pthread->sigpend,sig);
}
}
OpenPOWER on IntegriCloud