public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] hurd: Simplify _S_catch_exception_raise
@ 2023-04-17 23:24 Samuel Thibault
  0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2023-04-17 23:24 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=45000f12315c68f093293ec24d73860116bda0ba

commit 45000f12315c68f093293ec24d73860116bda0ba
Author: Sergey Bugaev <bugaevc@gmail.com>
Date:   Fri Apr 14 22:36:59 2023 +0300

    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>

Diff:
---
 hurd/catch-exc.c | 8 +-------
 1 file changed, 1 insertion(+), 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))
     {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-17 23:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-17 23:24 [glibc] hurd: Simplify _S_catch_exception_raise Samuel Thibault

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).