mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1664020 - ShutdownEvent::PostAndWait should return immediately if posting the event fails r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D89648
This commit is contained in:
parent
fd749e52c8
commit
a8fed672cb
@ -544,12 +544,18 @@ class ShutdownEvent : public Runnable {
|
||||
void PostAndWait() {
|
||||
MonitorAutoLock mon(mMonitor);
|
||||
|
||||
DebugOnly<nsresult> rv;
|
||||
rv = CacheFileIOManager::gInstance->mIOThread->Dispatch(
|
||||
nsresult rv = CacheFileIOManager::gInstance->mIOThread->Dispatch(
|
||||
this,
|
||||
CacheIOThread::WRITE); // When writes and closing of handles is done
|
||||
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
||||
|
||||
// If we failed to post the even there's no reason to go into the loop
|
||||
// because mNotified will never be set to true.
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("Posting ShutdownEvent task failed");
|
||||
return;
|
||||
}
|
||||
|
||||
TimeDuration waitTime = TimeDuration::FromSeconds(1);
|
||||
while (!mNotified) {
|
||||
mon.Wait(waitTime);
|
||||
|
Loading…
Reference in New Issue
Block a user