mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1225731 - Early bailout from TaskQueue::DispatchLocked(). r=froydnj
MozReview-Commit-ID: Xhj87WeRID --HG-- extra : rebase_source : 0de51688f506a1e302129e69a6353a9d48e6bfed
This commit is contained in:
parent
fa5d7da911
commit
edcebe85dc
@ -95,16 +95,17 @@ TaskQueue::DispatchLocked(nsCOMPtr<nsIRunnable>& aRunnable,
|
||||
DispatchFailureHandling aFailureHandling,
|
||||
DispatchReason aReason)
|
||||
{
|
||||
mQueueMonitor.AssertCurrentThreadOwns();
|
||||
if (mIsShutdown) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
AbstractThread* currentThread;
|
||||
if (aReason != TailDispatch && (currentThread = GetCurrent()) && RequiresTailDispatch(currentThread)) {
|
||||
currentThread->TailDispatcher().AddTask(this, aRunnable.forget(), aFailureHandling);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
mQueueMonitor.AssertCurrentThreadOwns();
|
||||
if (mIsShutdown) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
mTasks.push(aRunnable.forget());
|
||||
if (mIsRunning) {
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user