about summary refs log tree commit diff
path: root/sysdeps/mach/hurd/jmp-unwind.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/mach/hurd/jmp-unwind.c')
-rw-r--r--sysdeps/mach/hurd/jmp-unwind.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sysdeps/mach/hurd/jmp-unwind.c b/sysdeps/mach/hurd/jmp-unwind.c
index 20ca5f8aa6..fcb09119ce 100644
--- a/sysdeps/mach/hurd/jmp-unwind.c
+++ b/sysdeps/mach/hurd/jmp-unwind.c
@@ -41,14 +41,15 @@ _longjmp_unwind (jmp_buf env, int val)
   /* All access to SS->active_resources must take place inside a critical
      section where signal handlers cannot run.  */
   __spin_lock (&ss->lock);
-  assert (! ss->critical_section);
-  ss->critical_section = 1;
+  assert (! __spin_lock_locked (&ss->critical_section_lock));
+  __spin_lock (&ss->critical_section_lock);
 
   /* Remove local signal preempters being unwound past.  */
   while (ss->preempters &&
 	 _JMPBUF_UNWINDS (env[0].__jmpbuf, ss->preempters))
     ss->preempters = ss->preempters->next;
 
+  __spin_unlock (&ss->critical_section_lock);
   __spin_unlock (&ss->lock);
 
   /* Iterate over the current thread's list of active resources.