aboutsummaryrefslogtreecommitdiff
path: root/htl/pt-exit.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2022-02-14 01:39:35 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-02-14 19:29:02 +0100
commit7a06be051c01b4325927efab5b4e4280bb4a5a42 (patch)
tree91ff82a4692eb332afdf8f556b9ffc9d3bed804f /htl/pt-exit.c
parent06dbfcced3101886029ea3a46bcc98887d60f61e (diff)
downloadglibc-7a06be051c01b4325927efab5b4e4280bb4a5a42.tar
glibc-7a06be051c01b4325927efab5b4e4280bb4a5a42.tar.gz
glibc-7a06be051c01b4325927efab5b4e4280bb4a5a42.tar.bz2
glibc-7a06be051c01b4325927efab5b4e4280bb4a5a42.zip
htl: Destroy thread-specific data before releasing joins
Applications may want to assume that after pthread_join() returns, all thread-specific data has been released.
Diffstat (limited to 'htl/pt-exit.c')
-rw-r--r--htl/pt-exit.c6
1 files 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);