diff options
author | wtc%netscape.com <devnull@localhost> | 1999-11-03 01:37:19 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 1999-11-03 01:37:19 +0000 |
commit | c56f4e0c10dad8b0b1fb87cd535477c602294092 (patch) | |
tree | d75aa2ad643bf3e20f4161b5c5b0418708e807fb | |
parent | 9eb2a09c2840a358795325d5458d6b78c92115ae (diff) | |
download | nspr-hg-c56f4e0c10dad8b0b1fb87cd535477c602294092.tar.gz |
Bugzilla bug #15906: add support for the GC leak detector. Contributed
by Patrick Beard <beard@netscape.com>.
-rw-r--r-- | pr/src/threads/combined/pruthr.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pr/src/threads/combined/pruthr.c b/pr/src/threads/combined/pruthr.c index c6784ebe..bc1693b5 100644 --- a/pr/src/threads/combined/pruthr.c +++ b/pr/src/threads/combined/pruthr.c @@ -19,6 +19,7 @@ #include "primpl.h" #include <signal.h> #include <string.h> + #if defined(WIN95) /* ** Some local variables report warnings on Win95 because the code paths @@ -29,6 +30,10 @@ #pragma warning(disable : 4101) #endif +#if defined(XP_MAC) +#include <LowMem.h> +#endif + /* _pr_activeLock protects the following global variables */ PRLock *_pr_activeLock; PRInt32 _pr_primordialExitCount; /* In PR_Cleanup(), the primordial thread @@ -93,6 +98,8 @@ void _PR_InitThreads(PRThreadType type, PRThreadPriority priority, #else #if defined(SOLARIS) || defined (UNIXWARE) && defined (USR_SVR4_THREADS) stack->stackTop = (char*) &thread; +#elif defined(XP_MAC) + stack->stackTop = (char*) LMGetCurStackBase(); #else stack->stackTop = (char*) ((((long)&type + _pr_pageSize - 1) >> _pr_pageShift) << _pr_pageShift); @@ -1323,7 +1330,16 @@ PR_IMPLEMENT(PRThread*) _PR_CreateThread(PRThreadType type, /* Update thread type counter */ PR_Lock(_pr_activeLock); + /* + * We should just or in 'flags'. Until I verify + * that it works on all platforms, I'm going to + * ifdef it with XP_MAC. -- wtc@netscape.com + */ +#ifdef XP_MAC + thread->flags |= flags; +#else thread->flags = flags; +#endif thread->id = ++_pr_utid; if (type == PR_SYSTEM_THREAD) { thread->flags |= _PR_SYSTEM; |