summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>1998-12-10 19:58:23 +0000
committerwtc%netscape.com <devnull@localhost>1998-12-10 19:58:23 +0000
commitc0d97534172d0c696029710a88f73c9efe75d9d8 (patch)
tree85a292e142103f0e8aa04fc28117257e8d867349
parente117e88d0bce3b523f22f44c81a861c81edbbd4e (diff)
downloadnspr-hg-c0d97534172d0c696029710a88f73c9efe75d9d8.tar.gz
In PR_JoinThread, we need to call pthread_detach after pthread_join
under DCE threads because DCE threads' pthread_detach does not reclaim the terminated thread's resources.
-rw-r--r--pr/src/pthreads/ptthread.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pr/src/pthreads/ptthread.c b/pr/src/pthreads/ptthread.c
index e82e80c4..bafce771 100644
--- a/pr/src/pthreads/ptthread.c
+++ b/pr/src/pthreads/ptthread.c
@@ -478,6 +478,10 @@ PR_IMPLEMENT(PRStatus) PR_JoinThread(PRThread *thred)
PR_ASSERT(rv == 0 && result == NULL);
if (0 == rv)
{
+#ifdef _PR_DCETHREADS
+ rv = pthread_detach(&id);
+ PR_ASSERT(0 == rv);
+#endif
_pt_thread_death(thred);
}
else