about summary refs log tree commit diff
path: root/htl/pt-detach.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2022-01-22 00:12:05 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-01-22 02:17:19 +0100
commit8c86ba446367fd676457e51eb44d7af2e5d9a392 (patch)
tree110b0549f3a5708a1b27714d752fa1551e465f70 /htl/pt-detach.c
parente22a4557eb39d7cba9a74d70f4582c13f1a7a83a (diff)
downloadglibc-8c86ba446367fd676457e51eb44d7af2e5d9a392.tar.gz
glibc-8c86ba446367fd676457e51eb44d7af2e5d9a392.tar.xz
glibc-8c86ba446367fd676457e51eb44d7af2e5d9a392.zip
htl: Fix cleaning the reply port
If any RPC fails, the reply port will already be deallocated.
__pthread_thread_terminate thus has to defer taking its name until the very last
__thread_terminate_release which doesn't reply a message.  But then we
have to read from the pthread structure.

This introduces __pthread_dealloc_finish() which does the recording of
the thread termination, so the slot can be reused really only just before
the __thread_terminate_release call. Only the real thread can set it, so
let's decouple this from the pthread_state by just removing the
PTHREAD_TERMINATED state and add a terminated field.
Diffstat (limited to 'htl/pt-detach.c')
-rw-r--r--htl/pt-detach.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/htl/pt-detach.c b/htl/pt-detach.c
index 97017ed8f2..cb611f1b8f 100644
--- a/htl/pt-detach.c
+++ b/htl/pt-detach.c
@@ -62,12 +62,6 @@ __pthread_detach (pthread_t thread)
       __pthread_dealloc (pthread);
       break;
 
-    case PTHREAD_TERMINATED:
-      /* Pretend THREAD wasn't there in the first place.  */
-      __pthread_mutex_unlock (&pthread->state_lock);
-      err = ESRCH;
-      break;
-
     default:
       /* Thou shalt not detach non-joinable threads!  */
       __pthread_mutex_unlock (&pthread->state_lock);