public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/7] hurd: Simplify _hurd_critical_section_lock a bit
@ 2023-04-29 13:13 Sergey Bugaev
  2023-04-29 13:13 ` [PATCH 2/7] hurd: Move libc_hidden_def's around Sergey Bugaev
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Sergey Bugaev @ 2023-04-29 13:13 UTC (permalink / raw)
  To: libc-alpha; +Cc: bug-hurd, Samuel Thibault

This block of code was doing exactly what _hurd_self_sigstate does; so
just call that and let it do its job.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
---
 hurd/hurd/signal.h | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/hurd/hurd/signal.h b/hurd/hurd/signal.h
index 662e955e..302ca25e 100644
--- a/hurd/hurd/signal.h
+++ b/hurd/hurd/signal.h
@@ -218,19 +218,7 @@ _hurd_critical_section_lock (void)
     return NULL;
 #endif
 
-  ss = THREAD_GETMEM (THREAD_SELF, _hurd_sigstate);
-  if (ss == NULL)
-    {
-      thread_t self = __mach_thread_self ();
-
-      /* The thread variable is unset; this must be the first time we've
-	 asked for it.  In this case, the critical section flag cannot
-	 possible already be set.  Look up our sigstate structure the slow
-	 way.  */
-      ss = _hurd_thread_sigstate (self);
-      THREAD_SETMEM (THREAD_SELF, _hurd_sigstate, ss);
-      __mach_port_deallocate (__mach_task_self (), self);
-    }
+  ss = _hurd_self_sigstate ();
 
   if (! __spin_try_lock (&ss->critical_section_lock))
     /* We are already in a critical section, so do nothing.  */
-- 
2.40.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-04-29 15:01 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-29 13:13 [PATCH 1/7] hurd: Simplify _hurd_critical_section_lock a bit Sergey Bugaev
2023-04-29 13:13 ` [PATCH 2/7] hurd: Move libc_hidden_def's around Sergey Bugaev
2023-04-29 14:52   ` Samuel Thibault
2023-04-29 13:13 ` [PATCH 3/7] hurd: Mark various conditions as unlikely Sergey Bugaev
2023-04-29 14:53   ` Samuel Thibault
2023-04-29 13:13 ` [PATCH 4/7] hurd: Make _exit work during early boot-up Sergey Bugaev
2023-04-29 14:54   ` Samuel Thibault
2023-04-29 13:13 ` [PATCH 5/7] hurd: Don't leak the auth port in msg* RPCs Sergey Bugaev
2023-04-29 14:56   ` Samuel Thibault
2023-04-29 13:13 ` [PATCH 6/7] hurd: Respect existing FD_CLOEXEC in S_msg_set_fd Sergey Bugaev
2023-04-29 14:57   ` Samuel Thibault
2023-04-29 13:13 ` [PATCH 7/7] hurd: Fix FS_RETRY_MAGICAL "machtype" handling Sergey Bugaev
2023-04-29 15:01   ` Samuel Thibault
2023-04-29 14:50 ` [PATCH 1/7] hurd: Simplify _hurd_critical_section_lock a bit 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).