MediaManager holds 'mMutex' and then synchronously joins 'mMediaThread' at shutdown. We shouldn't block there because there are plenty of other components that need to do cleanup and could do so in parallel. Also, holding a lock while blocking there is a recipe for deadlock, since the other thread might try to grab the same lock...
The simplest thing I can think of would be to call StopSoon() and return, and then also observe "xpcom-shutdown-threads" where you could then call Stop(). Hopefully by that time the thread will have done its cleanup and joining will be fast.
Also note that for Bug 1046245 comment 81 I need for mMediaThread to call BackgroundChild::CloseForCurrentThread() when it shuts down, which is not happening since it's not an nsThread. Unless there's a way to have this happen by default, I'll probably need to PostTask to it from main on shutdown in any case, which might impact the approach we take here.
(In reply to Ben Turner [:bent] (use the needinfo flag!) from comment #0) > Also, holding a lock while blocking there is a recipe for deadlock, > since the other thread might try to grab the same lock... Yes, MediaManager::GetBackend() so this seems very real.
Related to bug 1164463 and likely will be resolved by it
Assignee: nobody → rjesup
Priority: -- → P2
See Also: → bug 1164463
Mass change P2->P3 to align with new Mozilla triage process.
Priority: P2 → P3
You need to log in before you can comment on or make changes to this bug.