Closed Bug 62097 Opened 25 years ago Closed 17 years ago

nsLoggingService thread safe

Categories

(Core :: XPCOM, enhancement, P3)

All
Windows 2000
enhancement

Tracking

()

RESOLVED INVALID
Future

People

(Reporter: rmarvin, Unassigned)

References

Details

There's no way to currently have logging services and use xpcom in a separate thread. Currently the nsLoggingService::gLoggingService is initialized even before XPCOM is started. When I attempt to NS_InitXPCOM in a child thread, nsLoggingService asserts as the owning thread is not the current thread. At first glance, this may seem logical, however, let me explain what I am after, and then you might have a better understanding of the situation. I desire to use the Necko engine as my network engine. The network traffic is secondary to the application, and it should all run in the background (on a child thread simply retrieving urls on an interval basis). Because the necko engine uses other services which are not thread safe (namely the nsCategoryManager and nsAppFileLocationProvider) I must initialize XPCOM within the same thread that I intend to perform the necko operations. That means starting up XPCOM in the child thread. With the limitation that nsLoggingService starts up in the main thread, there is no way to use logging services while running XPCOM in a child thread. In addition, there is no environment variable hooked up in the build process to turn off logging. Currently, one can only disable logging if the makefile is edited to add NS_DISABLE_LOGGING and NO_BUILD_REFCNT_LOGGING
Marking NEW and adding RFE
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: nsLoggingService is not thread safe → [RFE] nsLoggingService thread safe
Summary: [RFE] nsLoggingService thread safe → nsLoggingService thread safe
taking some of the bugs that I have been working on from scc.
Assignee: scc → dougt
Target Milestone: --- → mozilla1.1
Blocks: 101976
Target Milestone: mozilla1.1alpha → Future
Does this bug still mean anything? I can find nsLoggingService or gLoggingService anywhere in LXR...
QA Contact: kandrot → nobody
Assignee: dougt → nobody
QA Contact: nobody → xpcom
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.