Closed
Bug 23694
Opened 25 years ago
Closed 25 years ago
Enable the NT native-threads-only mode by a global variable
Categories
(NSPR :: NSPR, enhancement, P3)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: wtc, Assigned: wtc)
Details
Attachments
(2 files)
1.25 KB,
patch
|
Details | Diff | Splinter Review | |
1.22 KB,
patch
|
Details | Diff | Splinter Review |
Right now one enables the NT native-threads-only mode by setting the environment variable NSPR_NATIVE_THREADS_ONLY to 1. Although each process has its own environment, all NT services inherit the *system* environment. This means the NT services using NSPR cannot have different settings of the native-threads-only mode. It is proposed that we add a new way to enable the native-threads-only mode that allows individual NT services to have different settings. We can achieve this by having the main executable defining a DLL-exported global variable, and having NSPR look up that global variable during initialization. Suppose the global variable is named nspr_native_threads_only. A server that wants to enable the native-threads-only mode would define this variable in a file that is part of the main executable program as follows: #ifdef WINNT /* enable NSPR native-threads-only mode */ PR_IMPLEMENT_DATA(PRBool) nspr_native_threads_only = PR_TRUE; #endif I suggest that this new method have precedence over the old environment variable method. That is, if the nspr_native_threads_only global variable is defined, NSPR ignores the NSPR_NATIVE_THREADS_ONLY environment variable.
Assignee | ||
Comment 1•25 years ago
|
||
Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•25 years ago
|
||
Some comments on the proposed patch: 1. The magic global variable "nspr_native_threads_only" is of the type PRBool. It must be defined in the main executable using the DLL-export qualifier (e.g., the PR_IMPLEMENT_DATA macro). 2. The magic global variable has precedence over the magic environment variable.
The patch looks good. It can be made more general to allow setting or resetting of the native-threads-only mode when nspr_native_threads_only is PR_TRUE and PR_FALSE respectively, independent of the default mode. Same applies for the environment variable.
Assignee | ||
Comment 4•25 years ago
|
||
Assignee | ||
Updated•25 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 6•25 years ago
|
||
The fix is checked in. /cvsroot/mozilla/nsprpub/pr/src/misc/prinit.c, revision 3.18 The fix is also checked into the internal repository. /m/src/ns/nspr20/pr/src/misc/prinit.c, revision 2.38
Comment hidden (collapsed) |
You need to log in
before you can comment on or make changes to this bug.
Description
•