gecko-dev/xpcom/threads
Boris Zbarsky 3ae961a2da Bug 1589561. Factor out idle handling from PrioritizedEventQueue. r=smaug
We could try to move the EnforcePendingTaskGuarantee() bit into
PeekIdleDeadline, but then we'd need to check HasReadyEvent() on
mDeferredTimersQueue and mIdleQueue before we possibly unlock the mutex under
PeekIdleDeadline, and it's not clear that that state cannot change once the
mutex is unlocked...

The EnsureIsActive() call at the end of GetIdleDeadlineInternal in the !aIsPeek
case only makes sense if there are in fact idle tasks available to run when
GetDeadlineForIdleTask is called, because otherwise it would incorrectly set us
active when we are not running any tasks.

Differential Revision: https://phabricator.services.mozilla.com/D49696

--HG--
rename : xpcom/threads/PrioritizedEventQueue.cpp => xpcom/threads/IdlePeriodState.cpp
rename : xpcom/threads/PrioritizedEventQueue.h => xpcom/threads/IdlePeriodState.h
extra : moz-landing-system : lando
2019-10-20 15:08:44 +00:00
..
AbstractEventQueue.h
AbstractThread.cpp
AbstractThread.h
BlockingResourceBase.cpp
BlockingResourceBase.h
components.conf
CondVar.h
CPUUsageWatcher.cpp
CPUUsageWatcher.h
DataMutex.h Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan 2019-10-06 18:29:55 +00:00
DeadlockDetector.h
EventQueue.cpp
EventQueue.h Bug 1563063 - Cross-process idle handling, r=farre 2019-09-24 14:33:57 +00:00
IdlePeriodState.cpp Bug 1589561. Factor out idle handling from PrioritizedEventQueue. r=smaug 2019-10-20 15:08:44 +00:00
IdlePeriodState.h Bug 1589561. Factor out idle handling from PrioritizedEventQueue. r=smaug 2019-10-20 15:08:44 +00:00
IdleTaskRunner.cpp
IdleTaskRunner.h
InputEventStatistics.cpp
InputEventStatistics.h
LazyIdleThread.cpp
LazyIdleThread.h
LeakRefPtr.h
MainThreadIdlePeriod.cpp
MainThreadIdlePeriod.h
MainThreadQueue.h
MainThreadUtils.h
Monitor.h
moz.build Bug 1589561. Factor out idle handling from PrioritizedEventQueue. r=smaug 2019-10-20 15:08:44 +00:00
MozPromise.h Bug 1575744 - P4. Add MozPromise::FromDomPromise. r=bholley 2019-09-20 04:09:46 +00:00
MozPromiseInlines.h Bug 1575744 - P4. Add MozPromise::FromDomPromise. r=bholley 2019-09-20 04:09:46 +00:00
Mutex.h
nsEnvironment.cpp Bug 1575479 - Encapsulate mBaseHashtableET::mData. r=froydnj 2019-09-10 13:51:09 +00:00
nsEnvironment.h
nsICancelableRunnable.h
nsIEnvironment.idl
nsIEventTarget.idl Backed out 2 changesets (bug 1510226) for causing xpcshell crashes and xpcshell failures in test_TelemetrySession.js CLOSED TREE 2019-09-25 04:25:07 +03:00
nsIIdlePeriod.idl
nsIIdleRunnable.h
nsINamed.idl
nsIProcess.idl
nsIRunnable.idl
nsISerialEventTarget.idl
nsISupportsPriority.idl
nsIThread.idl
nsIThreadInternal.idl
nsIThreadManager.idl
nsIThreadPool.idl
nsITimer.idl
nsMemoryPressure.cpp
nsMemoryPressure.h
nsProcess.h Bug 1584969 - Use nsMaybeWeakPtr to simplify the nsIProcess implementation r=kmag 2019-09-30 18:28:31 +00:00
nsProcessCommon.cpp Bug 1584969 - Use nsMaybeWeakPtr to simplify the nsIProcess implementation r=kmag 2019-09-30 18:28:31 +00:00
nsProxyRelease.cpp
nsProxyRelease.h
nsThread.cpp Backed out 2 changesets (bug 1510226) for causing xpcshell crashes and xpcshell failures in test_TelemetrySession.js CLOSED TREE 2019-09-25 04:25:07 +03:00
nsThread.h Backed out 2 changesets (bug 1510226) for causing xpcshell crashes and xpcshell failures in test_TelemetrySession.js CLOSED TREE 2019-09-25 04:25:07 +03:00
nsThreadManager.cpp Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan 2019-10-06 18:29:55 +00:00
nsThreadManager.h Backed out changeset 9364cff86a7e (bug 1584568) by dev's request 2019-09-27 23:54:11 +03:00
nsThreadPool.cpp Bug 1583964 - make IsOnCurrentThread for thread pools constant-time; r=KrisWright 2019-09-25 22:02:08 +00:00
nsThreadPool.h
nsThreadSyncDispatch.h
nsThreadUtils.cpp Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan 2019-10-06 18:29:55 +00:00
nsThreadUtils.h Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan 2019-10-06 18:29:55 +00:00
nsTimerImpl.cpp
nsTimerImpl.h
PerformanceCounter.cpp
PerformanceCounter.h
PrioritizedEventQueue.cpp Bug 1589561. Factor out idle handling from PrioritizedEventQueue. r=smaug 2019-10-20 15:08:44 +00:00
PrioritizedEventQueue.h Bug 1589561. Factor out idle handling from PrioritizedEventQueue. r=smaug 2019-10-20 15:08:44 +00:00
Queue.h
RecursiveMutex.cpp
RecursiveMutex.h
ReentrantMonitor.h
RWLock.cpp
RWLock.h
SchedulerGroup.cpp
SchedulerGroup.h
SharedThreadPool.cpp
SharedThreadPool.h
StateMirroring.h
StateWatching.h
SynchronizedEventQueue.cpp
SynchronizedEventQueue.h Bug 1563063 - Cross-process idle handling, r=farre 2019-09-24 14:33:57 +00:00
SyncRunnable.h
SystemGroup.cpp
SystemGroup.h
TaskCategory.h
TaskDispatcher.h
TaskQueue.cpp Backed out 2 changesets (bug 1510226) for causing xpcshell crashes and xpcshell failures in test_TelemetrySession.js CLOSED TREE 2019-09-25 04:25:07 +03:00
TaskQueue.h Backed out 2 changesets (bug 1510226) for causing xpcshell crashes and xpcshell failures in test_TelemetrySession.js CLOSED TREE 2019-09-25 04:25:07 +03:00
ThreadBound.h
ThreadDelay.cpp
ThreadDelay.h
ThreadEventQueue.cpp Bug 1563063 - Cross-process idle handling, r=farre 2019-09-24 14:33:57 +00:00
ThreadEventQueue.h Bug 1563063 - Cross-process idle handling, r=farre 2019-09-24 14:33:57 +00:00
ThreadEventTarget.cpp Backed out 2 changesets (bug 1510226) for causing xpcshell crashes and xpcshell failures in test_TelemetrySession.js CLOSED TREE 2019-09-25 04:25:07 +03:00
ThreadEventTarget.h Backed out 2 changesets (bug 1510226) for causing xpcshell crashes and xpcshell failures in test_TelemetrySession.js CLOSED TREE 2019-09-25 04:25:07 +03:00
ThreadLocalVariables.cpp
ThrottledEventQueue.cpp
ThrottledEventQueue.h
TimerThread.cpp
TimerThread.h