diff options
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/mach/hurd/pt-sigstate.c | 12 | ||||
-rw-r--r-- | sysdeps/mach/i386/bits/spin-lock-inline.h (renamed from sysdeps/i386/bits/spin-lock-inline.h) | 0 | ||||
-rw-r--r-- | sysdeps/mach/i386/bits/spin-lock.h (renamed from sysdeps/i386/bits/spin-lock.h) | 0 |
3 files changed, 10 insertions, 2 deletions
diff --git a/sysdeps/mach/hurd/pt-sigstate.c b/sysdeps/mach/hurd/pt-sigstate.c index 68c79c5..2af3e39 100644 --- a/sysdeps/mach/hurd/pt-sigstate.c +++ b/sysdeps/mach/hurd/pt-sigstate.c @@ -21,6 +21,7 @@ #include <assert.h> #include <signal.h> #include <hurd/signal.h> +#include <hurd/msg.h> #include <pt-internal.h> @@ -31,11 +32,12 @@ __pthread_sigstate (struct __pthread *thread, int how, { error_t err = 0; struct hurd_sigstate *ss; + sigset_t pending; ss = _hurd_thread_sigstate (thread->kernel_thread); assert (ss); - __pthread_spin_lock (&ss->lock); + _hurd_sigstate_lock (ss); if (oset) *oset = ss->blocked; @@ -63,7 +65,13 @@ __pthread_sigstate (struct __pthread *thread, int how, if (! err && clear_pending) __sigemptyset (&ss->pending); - __pthread_spin_unlock (&ss->lock); + pending = _hurd_sigstate_pending (ss) & ~ss->blocked; + _hurd_sigstate_unlock (ss); + + if (! err && pending) + /* Send a message to the signal thread so it + will wake up and check for pending signals. */ + __msg_sig_post (_hurd_msgport, 0, 0, __mach_task_self ()); return err; } diff --git a/sysdeps/i386/bits/spin-lock-inline.h b/sysdeps/mach/i386/bits/spin-lock-inline.h index e5ed3de..e5ed3de 100644 --- a/sysdeps/i386/bits/spin-lock-inline.h +++ b/sysdeps/mach/i386/bits/spin-lock-inline.h diff --git a/sysdeps/i386/bits/spin-lock.h b/sysdeps/mach/i386/bits/spin-lock.h index 5ae81e1..5ae81e1 100644 --- a/sysdeps/i386/bits/spin-lock.h +++ b/sysdeps/mach/i386/bits/spin-lock.h |