author | Ben Turner <bent.mozilla@gmail.com> |
Fri, 19 Dec 2014 08:27:03 -0800 | |
changeset 220605 | 3285d8bef13f9baa5883270b4391bcc63a6fa5fb |
parent 220604 | 73dbbfed2b308b9ded17da84b68aacc44a8738a7 |
child 220606 | 8a89e46f8ff29b20632599a85d2a161409aa5d41 |
push id | 27990 |
push user | ryanvm@gmail.com |
push date | Fri, 19 Dec 2014 20:08:22 +0000 |
treeherder | mozilla-central@8880b5632e2b [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | froydnj |
bugs | 1113429 |
milestone | 37.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -68,17 +68,16 @@ #include "nsHostObjectProtocolHandler.h" #include "nsJSEnvironment.h" #include "nsJSUtils.h" #include "nsNetUtil.h" #include "nsPrintfCString.h" #include "nsProxyRelease.h" #include "nsSandboxFlags.h" #include "prthread.h" -#include "nsThread.h" #include "xpcpublic.h" #ifdef ANDROID #include <android/log.h> #endif #ifdef DEBUG #include "nsThreadManager.h" @@ -4328,27 +4327,16 @@ WorkerPrivate::DoRunLoop(JSContext* aCx) } Status currentStatus; bool normalRunnablesPending = false; { 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(); } ProcessAllControlRunnablesLocked(); currentStatus = mStatus; @@ -4848,16 +4836,25 @@ WorkerPrivate::WaitForWorkerEvents(PRInt // Let the main thread know that the worker is blocked and that memory // reporting may proceed. mBlockedForMemoryReporter = true; // 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); // We've gotten some kind of signal but we can't continue until the memory // reporter has finished. Wait again. while (mMemoryReporterRunning) { mMemoryReportCondVar.Wait(); }