public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [hurd, commited] htl: Destroy thread-specific data before releasing joins
@ 2022-02-14 18:29 Samuel Thibault
  0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2022-02-14 18:29 UTC (permalink / raw)
  To: libc-alpha; +Cc: Samuel Thibault, commit-hurd

Applications may want to assume that after pthread_join() returns, all
thread-specific data has been released.
---
 htl/pt-exit.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/htl/pt-exit.c b/htl/pt-exit.c
index db1c14c520..f0759c8738 100644
--- a/htl/pt-exit.c
+++ b/htl/pt-exit.c
@@ -54,6 +54,9 @@ __pthread_exit (void *status)
     /* We are the last thread.  */
     exit (0);
 
+  /* Destroy any thread specific data.  */
+  __pthread_destroy_specific (self);
+
   /* Note that after this point the process can be terminated at any
      point if another thread calls `pthread_exit' and happens to be
      the last thread.  */
@@ -92,9 +95,6 @@ __pthread_exit (void *status)
       break;
     }
 
-  /* Destroy any thread specific data.  */
-  __pthread_destroy_specific (self);
-
   /* Destroy any signal state.  */
   __pthread_sigstate_destroy (self);
 
-- 
2.34.1


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

only message in thread, other threads:[~2022-02-14 18:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-14 18:29 [hurd, commited] htl: Destroy thread-specific data before releasing joins 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).