From 8548d4c0841422a974065e0599ce71fd82f9ba7f Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 7 Feb 1995 04:25:56 +0000 Subject: [PATCH] Use spin lock operations on sigstate lock. Don't expect _hurd_self_sigstate to lock it. --- sysdeps/mach/hurd/alpha/sigreturn.c | 11 ++++++----- sysdeps/mach/hurd/mips/sigreturn.c | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/sysdeps/mach/hurd/alpha/sigreturn.c b/sysdeps/mach/hurd/alpha/sigreturn.c index 4adfb8d78f..e5dc383a3a 100644 --- a/sysdeps/mach/hurd/alpha/sigreturn.c +++ b/sysdeps/mach/hurd/alpha/sigreturn.c @@ -37,7 +37,8 @@ __sigreturn (struct sigcontext *scp) return -1; } - ss = _hurd_self_sigstate (); /* SS->lock now locked. */ + ss = _hurd_self_sigstate (); + __spin_lock (&ss->lock); /* Restore the set of blocked signals, and the intr_port slot. */ ss->blocked = scp->sc_mask; @@ -56,10 +57,10 @@ __sigreturn (struct sigcontext *scp) the SCP context is doing an interruptible RPC, but the signal thread will examine us while we are blocked in the sig_post RPC. */ ss->intr_port = MACH_PORT_NULL; - __mutex_unlock (&ss->lock); - __sig_post (_hurd_msgport, 0, __mach_task_self ()); + __spin_unlock (&ss->lock); + __msg_sig_post (_hurd_msgport, 0, __mach_task_self ()); /* If a pending signal was handled, sig_post never returned. */ - __mutex_lock (&ss->lock); + __spin_lock (&ss->lock); } if (scp->sc_onstack) @@ -69,7 +70,7 @@ __sigreturn (struct sigcontext *scp) abort (); } else - __mutex_unlock (&ss->lock); + __spin_unlock (&ss->lock); /* Destroy the MiG reply port used by the signal handler, and restore the reply port in use by the thread when interrupted. */ diff --git a/sysdeps/mach/hurd/mips/sigreturn.c b/sysdeps/mach/hurd/mips/sigreturn.c index d1d444f075..7396a8bb22 100644 --- a/sysdeps/mach/hurd/mips/sigreturn.c +++ b/sysdeps/mach/hurd/mips/sigreturn.c @@ -33,7 +33,8 @@ __sigreturn (struct sigcontext *scp) return -1; } - ss = _hurd_self_sigstate (); /* SS->lock now locked. */ + ss = _hurd_self_sigstate (); + __spin_lock (&ss->lock); /* Restore the set of blocked signals, and the intr_port slot. */ ss->blocked = scp->sc_mask; @@ -52,10 +53,10 @@ __sigreturn (struct sigcontext *scp) the SCP context is doing an interruptible RPC, but the signal thread will examine us while we are blocked in the sig_post RPC. */ ss->intr_port = MACH_PORT_NULL; - __mutex_unlock (&ss->lock); - __sig_post (_hurd_msgport, 0, __mach_task_self ()); + __spin_unlock (&ss->lock); + __msg_sig_post (_hurd_msgport, 0, __mach_task_self ()); /* If a pending signal was handled, sig_post never returned. */ - __mutex_lock (&ss->lock); + __spin_lock (&ss->lock); } if (scp->sc_onstack) @@ -65,7 +66,7 @@ __sigreturn (struct sigcontext *scp) abort (); } else - __mutex_unlock (&ss->lock); + __spin_unlock (&ss->lock); /* Destroy the MiG reply port used by the signal handler, and restore the reply port in use by the thread when interrupted. */