From: GNU Libc Maintainers Date: Sat, 17 Sep 2016 18:00:44 +0000 (+0000) Subject: libpthread_sigmask X-Git-Tag: archive/raspbian/2.25-3+rpi1~1^2^2^2^2^2^2^2^2^2^2^2^2~115 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=71a71411a32a7d2501876eadc7e9554908339120;p=glibc.git libpthread_sigmask * libpthread/sysdeps/mach/hurd/pt-sigstate.c (__pthread_sigstate): Wake up the message thread if any pending signals have been unblocked (code grabbed from glibc). Gbp-Pq: Topic hurd-i386 Gbp-Pq: Name libpthread_sigmask.diff --- diff --git a/libpthread/sysdeps/mach/hurd/pt-sigstate.c b/libpthread/sysdeps/mach/hurd/pt-sigstate.c index 68c79c5be..2af3e396e 100644 --- a/libpthread/sysdeps/mach/hurd/pt-sigstate.c +++ b/libpthread/sysdeps/mach/hurd/pt-sigstate.c @@ -21,6 +21,7 @@ #include #include #include +#include #include @@ -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; }