summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>2003-04-09 01:34:44 +0000
committerwtc%netscape.com <devnull@localhost>2003-04-09 01:34:44 +0000
commit279182abc5ee06e35eed9b2ac821c892a9aa2b55 (patch)
tree7e18e06a7998547378cdbf5a32cc94adb9815b9b
parentc71604ccde4f9b8c47b59f20c79628552001030b (diff)
downloadnspr-hg-279182abc5ee06e35eed9b2ac821c892a9aa2b55.tar.gz
Bug 198634: we need to implement PR_DetachThread on the platforms that
don't have a way to detach the foreign threads automatically when they terminate (e.g., OS/2). The patch is contributed by Michael Kaply <mkaply@us.ibm.com>. Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
-rw-r--r--pr/src/threads/combined/pruthr.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/pr/src/threads/combined/pruthr.c b/pr/src/threads/combined/pruthr.c
index 1329bb66..cbdfd2c0 100644
--- a/pr/src/threads/combined/pruthr.c
+++ b/pr/src/threads/combined/pruthr.c
@@ -1509,6 +1509,18 @@ PR_IMPLEMENT(PRThread*) PR_AttachThread(PRThreadType type,
PR_IMPLEMENT(void) PR_DetachThread(void)
{
+ /*
+ * On IRIX and Windows, foreign threads are detached when
+ * they terminate.
+ */
+#if !defined(IRIX) && !defined(WIN32)
+ PRThread *me;
+ if (_pr_initialized) {
+ me = _MD_GET_ATTACHED_THREAD();
+ if ((me != NULL) && (me->flags & _PR_ATTACHED))
+ _PRI_DetachThread();
+ }
+#endif
}
void _PRI_DetachThread(void)