From 53a811b4182c5cac8fea82c976a95c6bc9c177ee Mon Sep 17 00:00:00 2001 From: deischen Date: Sun, 16 Dec 2001 13:26:44 +0000 Subject: When cancelling a thread while in a join operation, do not detach the target thread of the join operation. This allows the cancelled thread to detach the target thread in its cancellation handler. This bug was found by Butenhof's cancel_subcontract test. Reviewed by: jasone --- lib/libpthread/thread/thr_cancel.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'lib/libpthread/thread') diff --git a/lib/libpthread/thread/thr_cancel.c b/lib/libpthread/thread/thr_cancel.c index 67c1fb4..4c6ca98 100644 --- a/lib/libpthread/thread/thr_cancel.c +++ b/lib/libpthread/thread/thr_cancel.c @@ -65,14 +65,11 @@ _pthread_cancel(pthread_t pthread) case PS_JOIN: /* - * Disconnect the thread from the joinee and - * detach: + * Disconnect the thread from the joinee: */ if (pthread->join_status.thread != NULL) { pthread->join_status.thread->joiner = NULL; - pthread_detach((pthread_t) - pthread->join_status.thread); } pthread->cancelflags |= PTHREAD_CANCELLING; PTHREAD_NEW_STATE(pthread, PS_RUNNING); -- cgit v1.1