Closed Bug 900711 Opened 11 years ago Closed 11 years ago

~nsIThreadPool can run the event loop if shutdown has not been called

Categories

(Core :: XPCOM, defect)

x86_64
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26
Tracking Status
firefox25 --- fixed
firefox26 --- fixed

People

(Reporter: karlt, Assigned: bent.mozilla)

References

(Blocks 1 open bug)

Details

(Whiteboard: [qa-])

Attachments

(1 file)

nsIThreadPool is scriptable. Better to leak the thread than run an event loop during GC
Blocks: 686402
See Also: → 900337
I think a better solution would be to just make the destructor delay-shutdown any remaining threads.
Hmm. Perhaps that is possible. During XPCOM shutdown, there is no thread to delay shutdown, but maybe that's OK because the thread manager will have already shut down the threads.
Attached patch changes.patchSplinter Review
Something like this perhaps.
Assignee: nobody → bent.mozilla
Status: NEW → ASSIGNED
Attachment #785112 - Flags: review?(ehsan)
Comment on attachment 785112 [details] [diff] [review] changes.patch Review of attachment 785112 [details] [diff] [review]: ----------------------------------------------------------------- ::: xpcom/threads/nsThreadPool.cpp @@ +41,5 @@ > +{ > +public: > + NS_DECL_NSIRUNNABLE > + > + ShutdownHelper(nsCOMArray<nsIThread>& aThreads, Nit: const.
Attachment #785112 - Flags: review?(ehsan) → review+
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #4) > Nit: const. We spoke about this on irc, const can't work here due to the SwapElements calls. https://hg.mozilla.org/integration/mozilla-inbound/rev/7236065ca5bf
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Blocks: 914030
Comment on attachment 785112 [details] [diff] [review] changes.patch Requesting approval for 914030 comment 4. [Approval Request Comment] Bug caused by (feature/regressing bug #): old bug User impact if declined: will need to make similar existing logic in webaudio more complex. Testing completed (on m-c, etc.): on m-c for almost 3 weeks Risk to taking this patch (and alternatives if risky): What gives me confidence about the low risk of taking this patch is that any scenarios affected by this patch would most likely have been a security risk and so should not exist. If any do still exist, they are better off with this patch. String or IDL/UUID changes made by this patch: none
Attachment #785112 - Flags: approval-mozilla-aurora?
Is bug 914030 being targeted for FF25? Trying to understand the rationale here.
(In reply to Alex Keybl [:akeybl] from comment #9) > Is bug 914030 being targeted for FF25? Trying to understand the rationale > here. Yes, webaudio is targeted for FF25, and bug 914030 is part of that.
Comment on attachment 785112 [details] [diff] [review] changes.patch [Triage Comment] FF25 is now on Beta, we are targeting Web Audio for 25 so let's get this in early in order to get testing & verification time.
Attachment #785112 - Flags: approval-mozilla-aurora? → approval-mozilla-beta+
Assuming no verification needed here. Please add the verifyme keyword and remove the [qa-] whiteboard tag to request verification.
Whiteboard: [qa-]
Sorry, this was mostly a non-bug. Threads keep a reference to the nsThreadPool until they return from Run() after removing themselves from mThreads, so mThreads is always empty in the destructor, and Shutdown() was a no-op. I think someone put the Shutdown() call in the destructor to confuse us ;) I'll tidy this up in bug 926522.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: