mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 13:25:37 +00:00
Bug 1113429 - Optimize NUWA idle notifications on workers, r=froydnj.
This commit is contained in:
parent
5480fb5918
commit
6567898382
@ -73,7 +73,6 @@
|
||||
#include "nsProxyRelease.h"
|
||||
#include "nsSandboxFlags.h"
|
||||
#include "prthread.h"
|
||||
#include "nsThread.h"
|
||||
#include "xpcpublic.h"
|
||||
|
||||
#ifdef ANDROID
|
||||
@ -4333,17 +4332,6 @@ 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() &&
|
||||
!(normalRunnablesPending = NS_HasPendingEvents(mThread))) {
|
||||
WaitForWorkerEvents();
|
||||
@ -4853,6 +4841,15 @@ 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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user