Skip to content

Commit

Permalink
Bug 758583. Must acquire SourceMediaStream lock before MediaStreamGra…
Browse files Browse the repository at this point in the history
…ph lock. r=jesup
  • Loading branch information
rocallahan committed May 29, 2012
1 parent 79b105a commit 5728700
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions content/media/MediaStreamGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1306,11 +1306,17 @@ MediaStreamGraphImpl::RunThread()
if (mForceShutDown || (IsEmpty() && mMessageQueue.IsEmpty())) {
// Enter shutdown mode. The stable-state handler will detect this
// and complete shutdown. Destroy any streams immediately.
for (PRUint32 i = 0; i < mStreams.Length(); ++i) {
mStreams[i]->DestroyImpl();
}
LOG(PR_LOG_DEBUG, ("MediaStreamGraph %p waiting for main thread cleanup", this));
mLifecycleState = LIFECYCLE_WAITING_FOR_MAIN_THREAD_CLEANUP;
{
MonitorAutoUnlock unlock(mMonitor);
// Unlock mMonitor while destroying our streams, since
// SourceMediaStream::DestroyImpl needs to take its lock while
// we're not holding mMonitor.
for (PRUint32 i = 0; i < mStreams.Length(); ++i) {
mStreams[i]->DestroyImpl();
}
}
return;
}

Expand Down

0 comments on commit 5728700

Please sign in to comment.