mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 21:00:50 +00:00
Bug 1122420 - Improve after-shutdown dispatch assertion on CacheIOThread. r=michal
--HG-- extra : rebase_source : f4e438e004b4e18e81ce35db5659a6c9cef18ce1
This commit is contained in:
parent
827fee71cd
commit
adddf68b3c
@ -27,6 +27,7 @@ CacheIOThread::CacheIOThread()
|
||||
, mHasXPCOMEvents(false)
|
||||
, mRerunCurrentEvent(false)
|
||||
, mShutdown(false)
|
||||
, mInsideLoop(true)
|
||||
{
|
||||
sSelf = this;
|
||||
}
|
||||
@ -237,6 +238,9 @@ loopStart:
|
||||
} while (true);
|
||||
|
||||
MOZ_ASSERT(!EventsPending());
|
||||
|
||||
// This is for correct assertion on XPCOM events dispatch.
|
||||
mInsideLoop = false;
|
||||
} // lock
|
||||
|
||||
if (threadInternal)
|
||||
@ -313,7 +317,7 @@ NS_IMETHODIMP CacheIOThread::OnDispatchedEvent(nsIThreadInternal *thread)
|
||||
{
|
||||
MonitorAutoLock lock(mMonitor);
|
||||
mHasXPCOMEvents = true;
|
||||
MOZ_ASSERT(!mShutdown || (PR_GetCurrentThread() == mThread));
|
||||
MOZ_ASSERT(mInsideLoop);
|
||||
lock.Notify();
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "nsTArray.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "mozilla/Monitor.h"
|
||||
#include "mozilla/DebugOnly.h"
|
||||
|
||||
class nsIRunnable;
|
||||
|
||||
@ -94,6 +95,7 @@ private:
|
||||
bool mHasXPCOMEvents;
|
||||
bool mRerunCurrentEvent;
|
||||
bool mShutdown;
|
||||
DebugOnly<bool> mInsideLoop;
|
||||
};
|
||||
|
||||
} // net
|
||||
|
Loading…
x
Reference in New Issue
Block a user