summaryrefslogtreecommitdiff
path: root/sysdeps/mach/hurd/htl/pt-sigstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/mach/hurd/htl/pt-sigstate.c')
-rw-r--r--sysdeps/mach/hurd/htl/pt-sigstate.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sysdeps/mach/hurd/htl/pt-sigstate.c b/sysdeps/mach/hurd/htl/pt-sigstate.c
index f7050ec0df..2ddceb229e 100644
--- a/sysdeps/mach/hurd/htl/pt-sigstate.c
+++ b/sysdeps/mach/hurd/htl/pt-sigstate.c
@@ -20,6 +20,7 @@
#include <assert.h>
#include <signal.h>
#include <hurd/signal.h>
+#include <hurd/msg.h>
#include <pt-internal.h>
@@ -29,11 +30,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);
- __spin_lock (&ss->lock);
+ _hurd_sigstate_lock (ss);
if (oset != NULL)
*oset = ss->blocked;
@@ -64,7 +66,13 @@ __pthread_sigstate (struct __pthread *thread, int how,
if (!err && clear_pending)
__sigemptyset (&ss->pending);
- __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;
}