mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 826829 - Change ImageContainerChild::DispatchSetIdle() to synchronous SetIdle(). r=kanru
This commit is contained in:
parent
763138cc5d
commit
5646bb17ed
@ -183,7 +183,7 @@ ImageContainer::SetCurrentImage(Image *aImage)
|
||||
if (aImage) {
|
||||
mImageContainerChild->SendImageAsync(this, aImage);
|
||||
} else {
|
||||
mImageContainerChild->DispatchSetIdle();
|
||||
mImageContainerChild->SetIdle();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,12 +73,33 @@ void ImageContainerChild::SetIdleNow()
|
||||
mImageQueue.Clear();
|
||||
}
|
||||
|
||||
void ImageContainerChild::DispatchSetIdle()
|
||||
void ImageContainerChild::SetIdleSync(Monitor* aBarrier, bool* aDone)
|
||||
{
|
||||
MonitorAutoLock autoMon(*aBarrier);
|
||||
|
||||
SetIdleNow();
|
||||
*aDone = true;
|
||||
aBarrier->NotifyAll();
|
||||
}
|
||||
|
||||
void ImageContainerChild::SetIdle()
|
||||
{
|
||||
if (mStop) return;
|
||||
|
||||
if (InImageBridgeChildThread()) {
|
||||
return SetIdleNow();
|
||||
}
|
||||
|
||||
Monitor barrier("SetIdle Lock");
|
||||
MonitorAutoLock autoMon(barrier);
|
||||
bool done = false;
|
||||
|
||||
GetMessageLoop()->PostTask(FROM_HERE,
|
||||
NewRunnableMethod(this, &ImageContainerChild::SetIdleNow));
|
||||
NewRunnableMethod(this, &ImageContainerChild::SetIdleSync, &barrier, &done));
|
||||
|
||||
while (!done) {
|
||||
barrier.Wait();
|
||||
}
|
||||
}
|
||||
|
||||
void ImageContainerChild::StopChildAndParent()
|
||||
|
@ -106,16 +106,9 @@ public:
|
||||
void DispatchDestroy();
|
||||
|
||||
/**
|
||||
* Dispatches a task on the ImageBridgeChild's thread that will call SendFlush
|
||||
* and deallocate the shared images in the pool.
|
||||
* Can be called on any thread.
|
||||
* Flush and deallocate the shared images in the pool.
|
||||
*/
|
||||
void DispatchSetIdle();
|
||||
|
||||
/**
|
||||
* Must be called on the ImageBridgeChild's thread.
|
||||
*/
|
||||
void SetIdleNow();
|
||||
void SetIdle();
|
||||
|
||||
/**
|
||||
* Can be called from any thread.
|
||||
@ -168,9 +161,21 @@ protected:
|
||||
}
|
||||
|
||||
/**
|
||||
* Must be called on the ImageBridgeCHild's thread.
|
||||
* Must be called on the ImageBridgeChild's thread.
|
||||
*/
|
||||
void DestroyNow();
|
||||
|
||||
/**
|
||||
* Dispatches a task on the ImageBridgeChild's thread that will call SendFlush
|
||||
* and deallocate the shared images in the pool.
|
||||
* Can be called on any thread.
|
||||
*/
|
||||
void SetIdleSync(Monitor* aBarrier, bool* aDone);
|
||||
|
||||
/**
|
||||
* Must be called on the ImageBridgeChild's thread.
|
||||
*/
|
||||
void SetIdleNow();
|
||||
|
||||
inline void SetID(uint64_t id)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user