Closed Bug 438822 Opened 16 years ago Closed 16 years ago

Nearly finished Events get processed again while shutdown.

Categories

(Core :: XPCOM, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: christianha1111, Unassigned)

Details

Attachments

(1 file)

It seams that an event gets processed again if it isn't completed before shutdown.

The following testcase does the following
1. create a nsIThread and dispatches a nsIRunnable (nsThreadTestSender.h/cpp)
2. In the run() it waits 10 seconds then creates an object of nsITheadTestObject which is a nsIRunnable as well
3. It saves the currentThread into the nsIThreadTestObject and dispatches the nsITheadTestObject to the mainthread.
4. In its run() the nsITheadTestObject calles ThreadFinished() a function of nsIThreadTest which is a self written service.
5. ThreadFinished() uses PR_Lock(lock) before shutdown the the thread in the nsITheadTestObject
6. after the shutdown it should PR_Unlock(lock)


Somewhere between 5 and 6 during the shutdown all pending events of the thread are getting processed. But there is only one event which isn't fully processed and this one gets started from the beginning. 

The result is, that it restarts at step 3 with the result that step 5 it will PR_Lock(lock) again which is not supported because lock are not reentrent.
Component: Event Handling → XPCOM
QA Contact: events → xpcom
You are creating 100 new threads, which means 100 attempts to call ThreadFinished. While the first is waiting in nsIThread::Shutdown the next one comes along and so fails.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: