mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 774388 - Patch 7: Block the main thread on compositor shutdown - r=mattwoodrow
This commit is contained in:
parent
f0b8964459
commit
ada1f420aa
@ -136,6 +136,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
static StaticRefPtr<CompositorThreadHolder> sCompositorThreadHolder;
|
static StaticRefPtr<CompositorThreadHolder> sCompositorThreadHolder;
|
||||||
|
static bool sFinishedCompositorShutDown = false;
|
||||||
|
|
||||||
static MessageLoop* sMainLoop = nullptr;
|
static MessageLoop* sMainLoop = nullptr;
|
||||||
|
|
||||||
@ -178,6 +179,7 @@ CompositorThreadHolder::DestroyCompositorThread(Thread* aCompositorThread)
|
|||||||
DestroyCompositorMap();
|
DestroyCompositorMap();
|
||||||
ReleaseImageBridgeParentSingleton();
|
ReleaseImageBridgeParentSingleton();
|
||||||
delete aCompositorThread;
|
delete aCompositorThread;
|
||||||
|
sFinishedCompositorShutDown = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Thread* CompositorThread() {
|
static Thread* CompositorThread() {
|
||||||
@ -203,6 +205,12 @@ void CompositorParent::ShutDown()
|
|||||||
MOZ_ASSERT(sCompositorThreadHolder, "The compositor thread has already been shut down!");
|
MOZ_ASSERT(sCompositorThreadHolder, "The compositor thread has already been shut down!");
|
||||||
|
|
||||||
sCompositorThreadHolder = nullptr;
|
sCompositorThreadHolder = nullptr;
|
||||||
|
|
||||||
|
// No locking is needed around sFinishedCompositorShutDown because it is only
|
||||||
|
// ever accessed on the main thread.
|
||||||
|
while (!sFinishedCompositorShutDown) {
|
||||||
|
NS_ProcessNextEvent(nullptr, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageLoop* CompositorParent::CompositorLoop()
|
MessageLoop* CompositorParent::CompositorLoop()
|
||||||
|
@ -170,6 +170,8 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Waits for all [CrossProcess]CompositorParent's to be gone,
|
* Waits for all [CrossProcess]CompositorParent's to be gone,
|
||||||
* and destroys the compositor thread and global compositor map.
|
* and destroys the compositor thread and global compositor map.
|
||||||
|
*
|
||||||
|
* Does not return until all of that has completed.
|
||||||
*/
|
*/
|
||||||
static void ShutDown();
|
static void ShutDown();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user