summaryrefslogtreecommitdiff
path: root/pr/src/threads/combined/pruthr.c
diff options
context:
space:
mode:
Diffstat (limited to 'pr/src/threads/combined/pruthr.c')
-rw-r--r--pr/src/threads/combined/pruthr.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/pr/src/threads/combined/pruthr.c b/pr/src/threads/combined/pruthr.c
index 0025bcbb..0bada3d1 100644
--- a/pr/src/threads/combined/pruthr.c
+++ b/pr/src/threads/combined/pruthr.c
@@ -1248,6 +1248,14 @@ PR_IMPLEMENT(PRThread*) _PR_CreateThread(PRThreadType type,
top = (char*)((PRUptrdiff)top & ~0x3f);
}
#endif
+#if defined(GC_LEAK_DETECTOR)
+ /*
+ * sorry, it is not safe to allocate the thread on the stack,
+ * because we assign to this object before the GC can learn
+ * about this thread. we'll just leak thread objects instead.
+ */
+ thread = PR_NEW(PRThread);
+#endif
stack->thr = thread;
memset(thread, 0, sizeof(PRThread));
thread->threadAllocatedOnStack = 1;