mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 976171 - crash in mozilla::net::CacheIOThread::LoopOneLevel(unsigned int), r=michal
This commit is contained in:
parent
9a6e8306aa
commit
39cdf6c4cb
@ -56,6 +56,9 @@ nsresult CacheIOThread::Dispatch(nsIRunnable* aRunnable, uint32_t aLevel)
|
||||
{
|
||||
NS_ENSURE_ARG(aLevel < LAST_LEVEL);
|
||||
|
||||
// Runnable is always expected to be non-null, hard null-check bellow.
|
||||
MOZ_ASSERT(aRunnable);
|
||||
|
||||
MonitorAutoLock lock(mMonitor);
|
||||
|
||||
if (mShutdown && (PR_GetCurrentThread() != mThread))
|
||||
@ -66,6 +69,9 @@ nsresult CacheIOThread::Dispatch(nsIRunnable* aRunnable, uint32_t aLevel)
|
||||
|
||||
nsresult CacheIOThread::DispatchAfterPendingOpens(nsIRunnable* aRunnable)
|
||||
{
|
||||
// Runnable is always expected to be non-null, hard null-check bellow.
|
||||
MOZ_ASSERT(aRunnable);
|
||||
|
||||
MonitorAutoLock lock(mMonitor);
|
||||
|
||||
if (mShutdown && (PR_GetCurrentThread() != mThread))
|
||||
@ -81,6 +87,9 @@ nsresult CacheIOThread::DispatchAfterPendingOpens(nsIRunnable* aRunnable)
|
||||
|
||||
nsresult CacheIOThread::DispatchInternal(nsIRunnable* aRunnable, uint32_t aLevel)
|
||||
{
|
||||
if (NS_WARN_IF(!aRunnable))
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
mMonitor.AssertCurrentThreadOwns();
|
||||
|
||||
mEventQueue[aLevel].AppendElement(aRunnable);
|
||||
|
Loading…
Reference in New Issue
Block a user