Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Backout change 3285d8bef13f (bug 1113429) due to backout of bug 970307.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cervantes Yu committed May 19, 2015
1 parent 170c33b commit 2f7dde7
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions dom/workers/WorkerPrivate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
#include "nsQueryObject.h"
#include "nsSandboxFlags.h"
#include "prthread.h"
#include "nsThread.h"
#include "xpcpublic.h"

#ifdef ANDROID
Expand Down Expand Up @@ -5106,6 +5107,17 @@ WorkerPrivate::DoRunLoop(JSContext* aCx)
{
MutexAutoLock lock(mMutex);

#ifdef MOZ_NUWA_PROCESS
{
nsThread *thr = static_cast<nsThread*>(NS_GetCurrentThread());
ReentrantMonitorAutoEnter mon(thr->ThreadStatusMonitor());
if (mControlQueue.IsEmpty() &&
!(normalRunnablesPending = NS_HasPendingEvents(mThread))) {
thr->SetIdle();
}
}
#endif // MOZ_NUWA_PROCESS

while (mControlQueue.IsEmpty() &&
!(debuggerRunnablesPending = !mDebuggerQueue.IsEmpty()) &&
!(normalRunnablesPending = NS_HasPendingEvents(mThread))) {
Expand Down Expand Up @@ -5642,15 +5654,6 @@ WorkerPrivate::WaitForWorkerEvents(PRIntervalTime aInterval)
// The main thread may be waiting so we must notify.
mMemoryReportCondVar.Notify();

#ifdef MOZ_NUWA_PROCESS
{
MOZ_ASSERT(mThread);

ReentrantMonitorAutoEnter mon(mThread->ThreadStatusMonitor());
mThread->SetIdle();
}
#endif // MOZ_NUWA_PROCESS

// Now wait for an actual worker event.
mCondVar.Wait(aInterval);

Expand Down

0 comments on commit 2f7dde7

Please sign in to comment.