diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-02-21 02:34:35 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-02-21 02:34:35 +0100 |
commit | 2ec583b0e9d55120e2538c2b8bacb292b6d3dada (patch) | |
tree | 4ca3f18e216c181ac452ff64652f1b999e874c7c /sysdeps/mach/hurd/sigsuspend.c | |
parent | c2fb0b60d1a90e8aeab2e2a90ab818bea30c617f (diff) |
Global signal dispositions.
Although they should not change the
default behaviors of signals for cthread programs, these patches add
new functions which can be used by libpthread to enable
POSIX-conforming behavior of signals on a per-thread basis.
e407ae3 Hurd signals: implement global signal dispositions
38eb4b3 Hurd signals: provide a sigstate destructor
344dfd6 Hurd signals: fix sigwait() for global signals
fb055f2 Hurd signals: fix global untraced signals.
Diffstat (limited to 'sysdeps/mach/hurd/sigsuspend.c')
-rw-r--r-- | sysdeps/mach/hurd/sigsuspend.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sysdeps/mach/hurd/sigsuspend.c b/sysdeps/mach/hurd/sigsuspend.c index 7e32472ce3..2e55e30fcb 100644 --- a/sysdeps/mach/hurd/sigsuspend.c +++ b/sysdeps/mach/hurd/sigsuspend.c @@ -1,5 +1,5 @@ -/* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2002, 2007 - Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2002, 2007, + 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -43,7 +43,7 @@ __sigsuspend (set) ss = _hurd_self_sigstate (); - __spin_lock (&ss->lock); + _hurd_sigstate_lock (ss); oldmask = ss->blocked; if (set != NULL) @@ -51,11 +51,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. */ @@ -66,10 +66,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. */ |