Closed Bug 886791 Opened 11 years ago Closed 11 years ago

Deadlock can occur if nsThreadPool::Dispatch() is called under lock

Categories

(Core :: XPCOM, defect)

defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: michal, Assigned: michal)

Details

Attachments

(1 file)

nsThreadPool::Dispatch() calls nsThreadPool::PutEvent() which can create and then possibly immediately shut down a new thread. nsIThread::Shutdown() processes pending events, so deadlock can occur.
Attached patch fixSplinter Review
Attachment #767174 - Flags: review?(benjamin)
Comment on attachment 767174 [details] [diff] [review]
fix

I feel like threadpool has other lock-ordering inconsistencies, but this will at least help short-term. I really don't think threadpool threads need to be XPCOM threads at all, but we can fix that elsewhere.
Attachment #767174 - Flags: review?(benjamin) → review+
https://hg.mozilla.org/mozilla-central/rev/4af89f71d745
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: