mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1145686 - Make MDSM::Shutdown happen on the state machine thread. r=jww
This commit is contained in:
parent
7a8d608d4a
commit
f63bfb2b8b
@ -637,7 +637,7 @@ void MediaDecoder::Shutdown()
|
||||
// necessary to unblock the state machine thread if it's blocked, so
|
||||
// the asynchronous shutdown in nsDestroyStateMachine won't deadlock.
|
||||
if (mDecoderStateMachine) {
|
||||
mDecoderStateMachine->Shutdown();
|
||||
mDecoderStateMachine->DispatchShutdown();
|
||||
}
|
||||
|
||||
// Force any outstanding seek and byterange requests to complete
|
||||
|
@ -1508,7 +1508,7 @@ void MediaDecoderStateMachine::SetDormant(bool aDormant)
|
||||
|
||||
void MediaDecoderStateMachine::Shutdown()
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
// Once we've entered the shutdown state here there's no going back.
|
||||
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
|
||||
|
@ -164,7 +164,16 @@ public:
|
||||
bool IsDormantNeeded();
|
||||
// Set/Unset dormant state.
|
||||
void SetDormant(bool aDormant);
|
||||
|
||||
private:
|
||||
void Shutdown();
|
||||
public:
|
||||
|
||||
void DispatchShutdown()
|
||||
{
|
||||
TaskQueue()->Dispatch(NS_NewRunnableMethod(this, &MediaDecoderStateMachine::Shutdown));
|
||||
}
|
||||
|
||||
void ShutdownReader();
|
||||
void FinishShutdown();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user