gecko-dev/xpcom/threads
Nathan Froyd 6d7cf47871 Bug 1498651 - make initial timer target setting more efficient; r=erahm
The NS_NewTimer* family of functions, when using a custom event target,
currently go through a path that looks something like:

  auto timer = createTimer()
  timer->SetTarget(target);
  // call the requisite Init* function
  return timer;

This setup is inefficient, because SetTarget requires the timer mutex to
be acquired.  The mutex acquisition here is completely unnecessary,
because the timer hasn't yet been shared out to the wider world; we can
set the timer target without acquiring the mutex at all because we know
that no sharing is possible at this point.

This patch reworks things somewhat to make that possible.
2018-10-17 19:57:36 -04:00
..
AbstractEventQueue.h Bug 1477512: Part 1 - Add memory reporter functions to thread event queues. r=erahm 2018-07-21 14:16:50 -07:00
AbstractThread.cpp Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
AbstractThread.h Bug 1465452 Part 12 - Record refcount changes for abstract threads, r=froydnj. 2018-07-21 14:35:23 +00:00
BlockingResourceBase.cpp Bug 1265824 - Add StaticMonitor r=froydnj 2018-06-29 15:27:22 -07:00
BlockingResourceBase.h
CondVar.h Bug 1265824 - Add StaticMonitor r=froydnj 2018-06-29 15:27:22 -07:00
CooperativeThreadPool.cpp
CooperativeThreadPool.h
CPUUsageWatcher.cpp Backed out changeset 531593bacc4e (bug 1448040) for Android build bustages on HangAnnotations.h. CLOSED TREE 2018-06-07 19:22:31 +03:00
CPUUsageWatcher.h Bug 1453795 - XPCOM - Initialize member fields in classes/ structures. r=froydnj 2018-06-15 14:41:20 +03:00
DeadlockDetector.h Bug 1207696 Part 4k - Don't record deadlock detector lock, r=froydnj. 2018-07-21 14:26:15 +00:00
EventQueue.cpp Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
EventQueue.h Bug 1477512: Part 1 - Add memory reporter functions to thread event queues. r=erahm 2018-07-21 14:16:50 -07:00
IdleTaskRunner.cpp Bug 1468112 - Use runnable name also for IdleTaskRunner's timer, r=farre 2018-06-12 12:17:08 +03:00
IdleTaskRunner.h Bug 1468112 - Use runnable name also for IdleTaskRunner's timer, r=farre 2018-06-12 12:17:08 +03:00
InputEventStatistics.cpp
InputEventStatistics.h
LabeledEventQueue.cpp
LabeledEventQueue.h Bug 1477512: Part 1 - Add memory reporter functions to thread event queues. r=erahm 2018-07-21 14:16:50 -07:00
LazyIdleThread.cpp Bug 1299118: Implement Long Tasks API internals (not DOM access to it) r=froyd,mstange 2018-10-11 13:22:55 -04:00
LazyIdleThread.h
LeakRefPtr.h
MainThreadIdlePeriod.cpp
MainThreadIdlePeriod.h
MainThreadQueue.h Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
MainThreadUtils.h
Monitor.h Bug 1465452 Part 1 - Allow platform mutexes to specify whether they are recorded, r=froydnj. 2018-07-21 14:28:21 +00:00
moz.build Bug 1486400 - add task dispatch/run delays for ChaosMode; r=jesup 2018-09-19 12:02:09 -04:00
MozPromise.h Bug 1468241 - P1. Add MozPromise::CreateAndResolveOrReject method r=gerald 2018-06-20 22:14:05 +00:00
Mutex.h Bug 1207696 Part 4b - Make recording optional in mozilla mutexes and monitors, r=froydnj. 2018-07-21 14:22:54 +00:00
nsEnvironment.cpp
nsEnvironment.h
nsICancelableRunnable.h
nsIEnvironment.idl
nsIEventTarget.idl
nsIIdlePeriod.idl
nsIIdleRunnable.h Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj 2018-06-17 22:43:11 -07:00
nsILabelableRunnable.cpp
nsILabelableRunnable.h
nsINamed.idl
nsIProcess.idl
nsIRunnable.idl
nsISerialEventTarget.idl
nsISupportsPriority.idl
nsIThread.idl Bug 1299118: Implement Long Tasks API internals (not DOM access to it) r=froyd,mstange 2018-10-11 13:22:55 -04:00
nsIThreadInternal.idl
nsIThreadManager.idl Bug 1479035: Part 2 - Get rid of PRThread to nsThread map. r=erahm 2018-07-27 15:26:08 -07:00
nsIThreadPool.idl
nsITimer.idl
nsMemoryPressure.cpp Bug 1335148 - Part 2: Introduce notification for end of memory pressure. r=gsvelto,snorp 2018-03-30 13:26:24 +02:00
nsMemoryPressure.h Bug 1335148 - Part 2: Introduce notification for end of memory pressure. r=gsvelto,snorp 2018-03-30 13:26:24 +02:00
nsProcess.h
nsProcessCommon.cpp Bug 1486690 - Remove unnecessary checks after moz_xmalloc() calls. r=glandium 2018-08-28 15:56:01 +10:00
nsProxyRelease.cpp
nsProxyRelease.h Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
nsThread.cpp Bug 1299118: Implement Long Tasks API internals (not DOM access to it) r=froyd,mstange 2018-10-11 13:22:55 -04:00
nsThread.h Bug 1299118: Implement Long Tasks API internals (not DOM access to it) r=froyd,mstange 2018-10-11 13:22:55 -04:00
nsThreadManager.cpp Bug 1479035: Part 2 - Get rid of PRThread to nsThread map. r=erahm 2018-07-27 15:26:08 -07:00
nsThreadManager.h Bug 1479035: Part 2 - Get rid of PRThread to nsThread map. r=erahm 2018-07-27 15:26:08 -07:00
nsThreadPool.cpp Bug 1486400 - add task dispatch/run delays for ChaosMode; r=jesup 2018-09-19 12:02:09 -04:00
nsThreadPool.h
nsThreadSyncDispatch.h Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
nsThreadUtils.cpp Bug 1495306 - When InitOtherFamilyNames is called during stylo traversal, ensure it posts its runnable back to the main thread. r=kmag 2018-10-01 23:38:55 +02:00
nsThreadUtils.h Bug 1495306 - When InitOtherFamilyNames is called during stylo traversal, ensure it posts its runnable back to the main thread. r=kmag 2018-10-01 23:38:55 +02:00
nsTimerImpl.cpp Bug 1498651 - make initial timer target setting more efficient; r=erahm 2018-10-17 19:57:36 -04:00
nsTimerImpl.h Bug 1498651 - make initial timer target setting more efficient; r=erahm 2018-10-17 19:57:36 -04:00
PerformanceCounter.cpp Bug 1477943 - Add a unique id per PerformanceCounter instance - r=baku,froydnj 2018-07-27 11:44:22 +02:00
PerformanceCounter.h Bug 1477943 - Add a unique id per PerformanceCounter instance - r=baku,froydnj 2018-07-27 11:44:22 +02:00
PrioritizedEventQueue.cpp Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
PrioritizedEventQueue.h Bug 1477512: Part 1 - Add memory reporter functions to thread event queues. r=erahm 2018-07-21 14:16:50 -07:00
Queue.h Bug 1477512: Part 1 - Add memory reporter functions to thread event queues. r=erahm 2018-07-21 14:16:50 -07:00
RecursiveMutex.cpp
RecursiveMutex.h
ReentrantMonitor.h Bug 1207696 Part 4b - Make recording optional in mozilla mutexes and monitors, r=froydnj. 2018-07-21 14:22:54 +00:00
RWLock.cpp
RWLock.h
Scheduler.cpp Bug 1493955 - Store floating-point preferences in a locale-independent way r=njn 2018-09-28 20:54:09 +00:00
Scheduler.h Bug 1493955 - Store floating-point preferences in a locale-independent way r=njn 2018-09-28 20:54:09 +00:00
SchedulerGroup.cpp Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
SchedulerGroup.h
SharedThreadPool.cpp Bug 1493737 - Fix many trivial calls to do_QueryInterface r=smaug 2018-10-01 21:38:01 +00:00
SharedThreadPool.h Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
StateMirroring.h
StateWatching.h
SynchronizedEventQueue.cpp
SynchronizedEventQueue.h Bug 1477512: Part 1 - Add memory reporter functions to thread event queues. r=erahm 2018-07-21 14:16:50 -07:00
SyncRunnable.h Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
SystemGroup.cpp Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
SystemGroup.h
TaskCategory.h
TaskDispatcher.h Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
TaskQueue.cpp Bug 1409664 - P8. Make explicit shutdown of TaskQueue optional. r=gerald 2018-07-03 11:45:18 -07:00
TaskQueue.h Bug 1409664 - P8. Make explicit shutdown of TaskQueue optional. r=gerald 2018-07-03 11:45:18 -07:00
ThreadDelay.cpp Bug 1492929 - Disable ChaosMode sleep delay on Windows. r=froydnj 2018-09-21 12:38:43 +00:00
ThreadDelay.h Bug 1486400 - add task dispatch/run delays for ChaosMode; r=jesup 2018-09-19 12:02:09 -04:00
ThreadEventQueue.cpp Bug 1477512: Follow-up: Un-inline ThreadEventQueue::SizeOfExcludingThis. r=me 2018-07-23 23:17:12 -07:00
ThreadEventQueue.h Bug 1477512: Follow-up: Un-inline ThreadEventQueue::SizeOfExcludingThis. r=me 2018-07-23 23:17:12 -07:00
ThreadEventTarget.cpp Bug 1486400 - add task dispatch/run delays for ChaosMode; r=jesup 2018-09-19 12:02:09 -04:00
ThreadEventTarget.h Bug 1477512: Part 1 - Add memory reporter functions to thread event queues. r=erahm 2018-07-21 14:16:50 -07:00
ThrottledEventQueue.cpp Bug 1499462: Remove dead failure handling and comments from ThrottledEventQueue::Create. r=froydnj 2018-10-16 21:24:48 +00:00
ThrottledEventQueue.h Bug 1499462: Remove dead failure handling and comments from ThrottledEventQueue::Create. r=froydnj 2018-10-16 21:24:48 +00:00
TimerThread.cpp Bug 1465452 Part 13 - Avoid recording some timer thread state, r=froydnj. 2018-07-21 14:36:02 +00:00
TimerThread.h