diff options
Diffstat (limited to 'sysdeps/mach/hurd/sigsuspend.c')
-rw-r--r-- | sysdeps/mach/hurd/sigsuspend.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sysdeps/mach/hurd/sigsuspend.c b/sysdeps/mach/hurd/sigsuspend.c index 60f235e1ee..b631e08722 100644 --- a/sysdeps/mach/hurd/sigsuspend.c +++ b/sysdeps/mach/hurd/sigsuspend.c @@ -41,7 +41,7 @@ __sigsuspend (set) ss = _hurd_self_sigstate (); - __spin_lock (&ss->lock); + _hurd_sigstate_lock (ss); oldmask = ss->blocked; if (set != NULL) @@ -49,11 +49,11 @@ __sigsuspend (set) ss->blocked = newmask & ~_SIG_CANT_MASK; /* Notice if any pending signals just became unblocked. */ - pending = ss->pending & ~ss->blocked; + pending = _hurd_sigstate_pending (ss) & ~ss->blocked; /* Tell the signal thread to message us when a signal arrives. */ ss->suspended = wait; - __spin_unlock (&ss->lock); + _hurd_sigstate_unlock (ss); if (pending) /* Tell the signal thread to check for pending signals. */ @@ -64,10 +64,11 @@ __sigsuspend (set) MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); __mach_port_destroy (__mach_task_self (), wait); - __spin_lock (&ss->lock); - ss->blocked = oldmask; /* Restore the old mask. */ - pending = ss->pending & ~ss->blocked; /* Again check for pending signals. */ - __spin_unlock (&ss->lock); + /* Restore the old mask and check for pending signals again. */ + _hurd_sigstate_lock (ss); + ss->blocked = oldmask; + pending = _hurd_sigstate_pending(ss) & ~ss->blocked; + _hurd_sigstate_unlock (ss); if (pending) /* Tell the signal thread to check for pending signals. */ |