From 9b59ea464e479210afc3585976c5b797939c9ef6 Mon Sep 17 00:00:00 2001 From: "wtchang%redhat.com" Date: Thu, 11 Jan 2007 02:06:17 +0000 Subject: [PATCH] Bug 254983: implemented PR_DetachThread for Unix. r=nelsonb git-svn-id: svn://10.0.0.236/trunk@218185 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/nsprpub/pr/src/pthreads/ptthread.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mozilla/nsprpub/pr/src/pthreads/ptthread.c b/mozilla/nsprpub/pr/src/pthreads/ptthread.c index edefb443eda..deb798e7628 100644 --- a/mozilla/nsprpub/pr/src/pthreads/ptthread.c +++ b/mozilla/nsprpub/pr/src/pthreads/ptthread.c @@ -620,7 +620,17 @@ PR_IMPLEMENT(PRStatus) PR_JoinThread(PRThread *thred) return (0 == rv) ? PR_SUCCESS : PR_FAILURE; } /* PR_JoinThread */ -PR_IMPLEMENT(void) PR_DetachThread(void) { } /* PR_DetachThread */ +PR_IMPLEMENT(void) PR_DetachThread(void) +{ + void *thred; + int rv; + + _PT_PTHREAD_GETSPECIFIC(pt_book.key, thred); + if (NULL == thred) return; + _pt_thread_death(thred); + rv = pthread_setspecific(pt_book.key, NULL); + PR_ASSERT(0 == rv); +} /* PR_DetachThread */ PR_IMPLEMENT(PRThread*) PR_GetCurrentThread(void) {