From 8827709aee565e13dbf160a6fab76aea73193630 Mon Sep 17 00:00:00 2001 From: "kaie%kuix.de" Date: Thu, 31 Jan 2008 16:25:26 +0000 Subject: Bug 414997, PR_NewThreadPrivateIndex contract is violated by PR_CreateThread impls Patch contributed by Wan-Teh Chang r=julien.pierre, r=me Landing on mini branch for ff3b3, intended for this fix only, because trunk is frozen --- pr/src/pthreads/ptthread.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pr/src/pthreads/ptthread.c b/pr/src/pthreads/ptthread.c index 2d4f6a91..1e3bef9b 100644 --- a/pr/src/pthreads/ptthread.c +++ b/pr/src/pthreads/ptthread.c @@ -257,6 +257,8 @@ static void *_pt_root(void *arg) */ if (PR_FALSE == detached) { + /* Call TPD destructors on this thread. */ + _PR_DestroyThreadPrivate(thred); rv = pthread_setspecific(pt_book.key, NULL); PR_ASSERT(0 == rv); } @@ -597,7 +599,7 @@ PR_IMPLEMENT(PRStatus) PR_JoinThread(PRThread *thred) rv = pthread_detach(&id); PR_ASSERT(0 == rv); #endif - _pt_thread_death(thred); + _pt_thread_death_internal(thred, PR_FALSE); } else { -- cgit v1.2.1