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

RESOLVED FIXED in mozilla25

Status

()

--
critical
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: michal, Assigned: michal)

Tracking

Trunk
mozilla25
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

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.
Created attachment 767174 [details] [diff] [review]
fix
Attachment #767174 - Flags: review?(benjamin)

Comment 2

5 years ago
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
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in before you can comment on or make changes to this bug.