diff options
author | wtc%netscape.com <devnull@localhost> | 2000-01-14 00:10:48 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 2000-01-14 00:10:48 +0000 |
commit | 2b853438a90efcb00095247fb8f9d370f0e7d7d6 (patch) | |
tree | f81eec889f34abe868b61be6d746e871edfc556b | |
parent | acb50b83e3545f820e5ffab3600b1f8377dfeb16 (diff) | |
download | nspr-hg-2b853438a90efcb00095247fb8f9d370f0e7d7d6.tar.gz |
Bugzilla bug #23694: added a global variable to control the
native-threads-only mode of our NT implementation. r=srinivas@netscape.com
-rw-r--r-- | pr/src/misc/prinit.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/pr/src/misc/prinit.c b/pr/src/misc/prinit.c index 8054228c..57fb1c9a 100644 --- a/pr/src/misc/prinit.c +++ b/pr/src/misc/prinit.c @@ -123,22 +123,34 @@ PR_IMPLEMENT(PRBool) PR_Initialized(void) { return _pr_initialized; } + PRInt32 _native_threads_only = 0; +#ifdef WINNT +static void _pr_SetNativeThreadsOnlyMode(void) +{ + HMODULE mainExe; + PRBool *globalp; + char *envp; + + mainExe = GetModuleHandle(NULL); + PR_ASSERT(NULL != mainExe); + globalp = (PRBool *) GetProcAddress(mainExe, "nspr_native_threads_only"); + if (globalp) { + _native_threads_only = (*globalp != PR_FALSE); + } else if (envp = getenv("NSPR_NATIVE_THREADS_ONLY")) { + _native_threads_only = (atoi(envp) == 1); + } +} +#endif static void _PR_InitStuff(void) { -#ifdef WINNT - char *envp; -#endif if (_pr_initialized) return; _pr_initialized = PR_TRUE; #ifdef WINNT - if (envp = getenv("NSPR_NATIVE_THREADS_ONLY")) { - if (atoi(envp) == 1) - _native_threads_only = 1; - } + _pr_SetNativeThreadsOnlyMode(); #endif |