about summary refs log tree commit diff
path: root/hurd/catch-exc.c
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2023-04-14 22:36:59 +0300
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-04-18 01:20:46 +0200
commit45000f12315c68f093293ec24d73860116bda0ba (patch)
tree9e9f75684ed390ecb1c8b1bc5d6be772a7a77614 /hurd/catch-exc.c
parent346b6eab3c14ead0b716d53e2235464b822f48f2 (diff)
downloadglibc-45000f12315c68f093293ec24d73860116bda0ba.tar.gz
glibc-45000f12315c68f093293ec24d73860116bda0ba.tar.xz
glibc-45000f12315c68f093293ec24d73860116bda0ba.zip
hurd: Simplify _S_catch_exception_raise
_hurd_thread_sigstate () already handles finding an existing sigstate
before allocating a new one, so just use that. Bonus: this will only
lock the _hurd_siglock once.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
Diffstat (limited to 'hurd/catch-exc.c')
-rw-r--r--hurd/catch-exc.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/hurd/catch-exc.c b/hurd/catch-exc.c
index 5ee2233aa9..d375bf6789 100644
--- a/hurd/catch-exc.c
+++ b/hurd/catch-exc.c
@@ -58,13 +58,7 @@ _S_catch_exception_raise (mach_port_t port,
   _hurd_exception2signal (&d, &signo);
 
   /* Find the sigstate structure for the faulting thread.  */
-  __mutex_lock (&_hurd_siglock);
-  for (ss = _hurd_sigstates; ss != NULL; ss = ss->next)
-    if (ss->thread == thread)
-      break;
-  __mutex_unlock (&_hurd_siglock);
-  if (ss == NULL)
-    ss = _hurd_thread_sigstate (thread); /* Allocate a fresh one.  */
+  ss = _hurd_thread_sigstate (thread);
 
   if (__spin_lock_locked (&ss->lock))
     {