gecko-dev/xpcom/threads
Sean Feng e903455002 Bug 1708070 - Change InputVsyncState in InputPriorityController::WillRunTask r=smaug
Before this patch, we use InputPriorityController::DidRunTask to change
InputVsyncState which is problematic.

Consider this scenario
  1. Two events are in the queue, vsync(V1) and input(I1)
  2. I1 runs and starts an inner event loop (We only expect one input
     event to be run because there's only one input event)
  3. Another input event(I2) arrives
  4. Inner event loop picks I2 to run
  5. When I2 is finished, it sets the InputVsyncState to `RunVsync`
  6. I1's DidRunTask is called and crashed because the state shouldn't
     be `RunVsync`.

This patch moves the code which checks InputVsyncState from `DidRunTask`
to `WillRunTask` so that the state is correctly checked and updated
before the input task is about to run.

Differential Revision: https://phabricator.services.mozilla.com/D117336
2021-06-09 17:01:30 +00:00
..
AbstractThread.cpp Bug 1695580 - In xpcom, cancel pending DelayedRunnable timers on shutdown. r=KrisWright 2021-04-06 20:15:11 +00:00
AbstractThread.h Bug 1678062 - Remove unnecessary includes. r=andi 2020-11-23 16:12:02 +00:00
BlockingResourceBase.cpp Bug 1706376 - Remove loud warning from BlockingResourceBase::Release(), r=xpcom-reviewers,mccr8 2021-05-06 20:05:33 +00:00
BlockingResourceBase.h Bug 1515229 - Make MozStackWalk/MozWalkTheStack frame skipping more reliable. r=gerald,nika,bobowen,jld 2021-04-16 04:06:02 +00:00
components.conf
CondVar.h Bug 1676361 - Clean up profiler includes. r=gerald 2020-11-23 16:09:13 +00:00
CPUUsageWatcher.cpp Bug 1660470 - Add missing include directives/forward declarations. r=nika 2020-11-23 16:21:38 +00:00
CPUUsageWatcher.h Bug 1678062 - Remove unnecessary includes. r=andi 2020-11-23 16:12:02 +00:00
DataMutex.h Bug 1671403 - DataMutexBase::Mutex() gives const& access to the mutex - r=sg 2020-11-19 11:47:08 +00:00
DeadlockDetector.h Bug 1184468 - Use nsBaseHashtable::Values. r=xpcom-reviewers,nika 2021-03-24 17:56:49 +00:00
DelayedRunnable.cpp Bug 1695580 - In xpcom, cancel pending DelayedRunnable timers on shutdown. r=KrisWright 2021-04-06 20:15:11 +00:00
DelayedRunnable.h Bug 1695580 - In xpcom, cancel pending DelayedRunnable timers on shutdown. r=KrisWright 2021-04-06 20:15:11 +00:00
EventQueue.cpp Bug 1708042, add control priority to the main thread, r=bas 2021-05-21 15:46:45 +00:00
EventQueue.h Bug 1708042, add control priority to the main thread, r=bas 2021-05-21 15:46:45 +00:00
IdlePeriodState.cpp Bug 1683031 - pt 5. Add an assertion and document idle request IDs r=smaug 2020-12-22 17:56:46 +00:00
IdlePeriodState.h Bug 1713320, ensure idle tasks get run, r=bas 2021-05-31 13:32:36 +00:00
IdleTaskRunner.cpp Bug 1705320 - Fix some spelling errors r=mccr8 DONTBUILD 2021-04-15 13:32:46 +00:00
IdleTaskRunner.h Bug 1698191: Convert IdleTaskRunner to use the TaskController API directly. r=smaug,sfink 2021-03-16 14:39:45 +00:00
InputEventStatistics.cpp Bug 1697585 - Make input tasks can be more strictly aligned with Vsync r=smaug 2021-04-14 19:56:42 +00:00
InputEventStatistics.h Bug 1697585 - Make input tasks can be more strictly aligned with Vsync r=smaug 2021-04-14 19:56:42 +00:00
InputTaskManager.cpp Bug 1708070 - Change InputVsyncState in InputPriorityController::WillRunTask r=smaug 2021-06-09 17:01:30 +00:00
InputTaskManager.h Bug 1708070 - Change InputVsyncState in InputPriorityController::WillRunTask r=smaug 2021-06-09 17:01:30 +00:00
LazyIdleThread.cpp
LazyIdleThread.h Bug 1678062 - Remove unnecessary includes. r=andi 2020-11-23 16:12:02 +00:00
LeakRefPtr.h
MainThreadIdlePeriod.cpp
MainThreadIdlePeriod.h
MainThreadUtils.h
Monitor.h
moz.build Bug 1697585 - Add VsyncTaskManager r=bas,smaug 2021-04-14 19:56:42 +00:00
MozPromise.h Bug 1629064 - pt 9. Use the current idle slice to start the GC if we can r=smaug 2021-05-12 06:46:11 +00:00
MozPromiseInlines.h
Mutex.h Bug 1678062 - Remove unnecessary includes. r=andi 2020-11-23 16:12:02 +00:00
nsEnvironment.cpp
nsEnvironment.h
nsICancelableRunnable.h Bug 1119956 add CancelableRunnable documentation to clarify expectations r=sg 2020-12-01 10:05:21 +00:00
nsIDelayedRunnableObserver.h Bug 1695580 - In xpcom, cancel pending DelayedRunnable timers on shutdown. r=KrisWright 2021-04-06 20:15:11 +00:00
nsIDirectTaskDispatcher.idl
nsIDiscardableRunnable.h Bug 1119956 introduce DiscardableRunnable for tasks that might not run but might not implement cancellation r=asuth,sg 2020-12-02 09:36:25 +00:00
nsIEnvironment.idl
nsIEventTarget.idl
nsIIdlePeriod.idl
nsIIdleRunnable.h
nsINamed.idl
nsIProcess.idl
nsIRunnable.idl Bug 1708042, add control priority to the main thread, r=bas 2021-05-21 15:46:45 +00:00
nsISerialEventTarget.idl
nsISupportsPriority.idl
nsIThread.idl
nsIThreadInternal.idl
nsIThreadManager.idl Bug 1696397: Move SpinEventLoopUntilOrShutdown to -Quit and move the current shutdown state logic from nsThreadManager to AppShutdown; r=kmag,xpcom-reviewers 2021-03-17 08:07:48 +00:00
nsIThreadPool.idl
nsITimer.idl Bug 1711090 - Part 4: Remove non-string func timer names, r=KrisWright 2021-05-18 20:45:17 +00:00
nsMemoryPressure.cpp
nsMemoryPressure.h
nsProcess.h Bug 1678062 - Remove unnecessary includes. r=andi 2020-11-23 16:12:02 +00:00
nsProcessCommon.cpp Bug 1660470 - Add missing include directives/forward declarations. r=nika 2020-11-23 16:21:38 +00:00
nsProxyRelease.cpp
nsProxyRelease.h Bug 1678062 - Remove unnecessary includes. r=andi 2020-11-23 16:12:02 +00:00
nsThread.cpp Bug 1695580 - In xpcom, cancel pending DelayedRunnable timers on shutdown. r=KrisWright 2021-04-06 20:15:11 +00:00
nsThread.h Bug 1695580 - In xpcom, cancel pending DelayedRunnable timers on shutdown. r=KrisWright 2021-04-06 20:15:11 +00:00
nsThreadManager.cpp Backed out 2 changesets (bug 1707924) for multiple failures with crash [@ BackgroundEventTarget::CreateBackgroundTaskQueue(char const*)]. CLOSED TREE 2021-04-30 06:20:24 +03:00
nsThreadManager.h Bug 1695580 - In xpcom, cancel pending DelayedRunnable timers on shutdown. r=KrisWright 2021-04-06 20:15:11 +00:00
nsThreadPool.cpp Bug 1691589 - Reduce reliance on GeckoProfiler.h when only labels (and maybe markers) are needed - r=necko-reviewers,geckoview-reviewers,sg,agi,florian 2021-02-16 04:44:19 +00:00
nsThreadPool.h Bug 1678062 - Remove unnecessary includes. r=andi 2020-11-23 16:12:02 +00:00
nsThreadSyncDispatch.h
nsThreadUtils.cpp Backed out 2 changesets (bug 1707924) for multiple failures with crash [@ BackgroundEventTarget::CreateBackgroundTaskQueue(char const*)]. CLOSED TREE 2021-04-30 06:20:24 +03:00
nsThreadUtils.h Bug 1519636 - Initial reformat of C/C++ code with clang-format version 12.0.0. r=sylvestre 2021-05-10 07:15:07 +00:00
nsTimerImpl.cpp Bug 1711090 - Part 4: Remove non-string func timer names, r=KrisWright 2021-05-18 20:45:17 +00:00
nsTimerImpl.h Bug 1711090 - Part 4: Remove non-string func timer names, r=KrisWright 2021-05-18 20:45:17 +00:00
PerformanceCounter.cpp
PerformanceCounter.h
Queue.h Bug 1706365 - Part 1: Safely invoke destructors and constructors in mozilla::Queue, r=xpcom-reviewers,kmag 2021-05-06 20:05:34 +00:00
RecursiveMutex.cpp
RecursiveMutex.h
ReentrantMonitor.h Bug 1676361 - Clean up profiler includes. r=gerald 2020-11-23 16:09:13 +00:00
RWLock.cpp
RWLock.h Bug 1660470 - Add missing include directives/forward declarations. r=nika 2020-11-23 16:21:38 +00:00
SchedulerGroup.cpp Bug 1675820 - Part 6: Make DocGroup cycle-collected, r=farre,smaug 2021-03-18 19:24:50 +00:00
SchedulerGroup.h Bug 1675820 - Part 6: Make DocGroup cycle-collected, r=farre,smaug 2021-03-18 19:24:50 +00:00
SharedThreadPool.cpp Bug 1184468 - Use nsTHashtable::Keys where possible. r=xpcom-reviewers,nika 2021-03-24 17:56:50 +00:00
SharedThreadPool.h Bug 1678062 - Remove unnecessary includes. r=andi 2020-11-23 16:12:02 +00:00
SpinEventLoopUntil.h Bug 1676365 - Move SpinEventLoopUntil to separate header. r=#xpcom-reviewers 2020-11-23 16:10:41 +00:00
StateMirroring.h Bug 1678062 - Remove unnecessary includes. r=andi 2020-11-23 16:12:02 +00:00
StateWatching.h Bug 1678062 - Remove unnecessary includes. r=andi 2020-11-23 16:12:02 +00:00
SynchronizedEventQueue.cpp
SynchronizedEventQueue.h Bug 1669256 - Part 5: Remove dead code from ProcessNextEvent and its supporting functions. r=smaug 2020-10-09 17:38:15 +00:00
SyncRunnable.h Bug 1595994 - P14. Don't dealock if we failed to dispatch a task and return error code. r=mattwoodrow 2020-10-20 23:28:10 +00:00
TaskCategory.h
TaskController.cpp Bug 1713287 - Change the number of threads TaskController creates to match those required by the JS engine r=bas 2021-06-09 09:23:20 +00:00
TaskController.h Bug 1704923 - Pass the number of threads when setting up an external thread pool r=sfink,bas 2021-06-03 10:24:13 +00:00
TaskDispatcher.h Bug 1678062 - Remove unnecessary includes. r=andi 2020-11-23 16:12:02 +00:00
TaskQueue.cpp Bug 1704887 - Discard results of RemoveElement for DelayedRunnable r=necko-reviewers,xpcom-reviewers,mccr8,valentin 2021-05-28 19:05:29 +00:00
TaskQueue.h Bug 1695580 - In xpcom, cancel pending DelayedRunnable timers on shutdown. r=KrisWright 2021-04-06 20:15:11 +00:00
ThreadBound.h
ThreadDelay.cpp
ThreadDelay.h
ThreadEventQueue.cpp Bug 1708042, add control priority to the main thread, r=bas 2021-05-21 15:46:45 +00:00
ThreadEventQueue.h Bug 1669256 - Part 5: Remove dead code from ProcessNextEvent and its supporting functions. r=smaug 2020-10-09 17:38:15 +00:00
ThreadEventTarget.cpp Bug 1704887 - Discard results of RemoveElement for DelayedRunnable r=necko-reviewers,xpcom-reviewers,mccr8,valentin 2021-05-28 19:05:29 +00:00
ThreadEventTarget.h Bug 1695580 - In xpcom, cancel pending DelayedRunnable timers on shutdown. r=KrisWright 2021-04-06 20:15:11 +00:00
ThreadLocalVariables.cpp
ThrottledEventQueue.cpp Bug 1669256 - Part 3: Remove priority related code from ThreadEventQueue. r=smaug 2020-10-09 16:57:40 +00:00
ThrottledEventQueue.h
TimerThread.cpp Bug 1415923 - Ignore sleep and wake notifications on OSX r=xpcom-reviewers,KrisWright 2021-02-04 21:40:47 +00:00
TimerThread.h
VsyncTaskManager.cpp Bug 1708070 - Use VsyncTaskManager::WillRunTask to change InputVsyncState r=smaug 2021-04-29 16:39:30 +00:00
VsyncTaskManager.h Bug 1708070 - Use VsyncTaskManager::WillRunTask to change InputVsyncState r=smaug 2021-04-29 16:39:30 +00:00