gecko-dev/xpcom/threads
Michael Layzell b34e7c42ec Bug 1365309 - Part 1: Move LUL to a separate lock, and initialize it outside of both the profiler and BHR lock on the BHR thread, r=njn
Currently LUL is a member of CorePS, meaning that it is guarded by the PSMutex.
This mutex is grabbed by the main thread at random points during the execution
of the program. This is unfortunate, as initializing LUL can take a long
time (>1s on my local machine), and we definitely don't want to be blocking the
main thread waiting for it.

In addition, in the BHR case, we used to be grabbing LUL when we got our first
hang, while both the PSMutex and the BHR monitor were being held. This meant
that the main thread could make no progress during LUL initializaion, as the BHR
monitor is grabbed by the main thread on every spin of the event loop.

This patch moves that initialization to be behind a completely separate lock,
and makes BHR initialize it on the background thread before acquiring the BHR
lock, meaning that no locks other than the one guarding LUL should be held
during its initialization.

MozReview-Commit-ID: GwNYQaEAqJ1
2017-07-12 13:13:07 -04:00
..
AbstractThread.cpp Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
AbstractThread.h Bug 1372736 - Avoid using AbstractThread for non-media MozPromises (r=bkelly) 2017-06-15 20:16:25 -07:00
BackgroundHangMonitor.cpp Bug 1365309 - Part 1: Move LUL to a separate lock, and initialize it outside of both the profiler and BHR lock on the BHR thread, r=njn 2017-07-12 13:13:07 -04:00
BackgroundHangMonitor.h
BlockingResourceBase.cpp Bug 1370644 - Part 1: Only use NS_ERROR for an imminent failure. r=froydnj 2017-06-12 16:53:04 -04:00
BlockingResourceBase.h
CondVar.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
DeadlockDetector.h
HangAnnotations.cpp
HangAnnotations.h
HangMonitor.cpp Bug 1377605 Cast -1 to DWORD to correctly match the error return value given by SuspendThread r=aklotz 2017-07-03 16:07:25 -05:00
HangMonitor.h
LazyIdleThread.cpp Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
LazyIdleThread.h Bug 1374580 (part 3) - Remove ns{,C}Substring typedefs. r=froydnj. 2017-06-20 19:19:52 +10:00
LeakRefPtr.h
MainThreadIdlePeriod.cpp Bug 1311425 - Add pref for how far into the timer queue, r=smaug,f=froydnj 2017-05-24 21:14:29 -04:00
MainThreadIdlePeriod.h Bug 1311425 - Add pref for how far into the timer queue, r=smaug,f=froydnj 2017-05-24 21:14:29 -04:00
MainThreadUtils.h Bug 1372670 - part 1 - remove non-MOZILLA_INTERNAL_API NS_IsMainThread(); r=erahm 2017-06-21 12:59:28 -04:00
Monitor.h Bug 1374594 - Allow mutex/monitor scoped unlockers to be constructed from their locking counterparts - r=froydnj 2017-06-20 22:20:49 +12:00
moz.build Backed out changeset 733c828d5ba3 (bug 1355746) for frequently failing mochitest dom/html/test/test_fullscreen-api.html and devtools' browser_service_workers_multi_content_process.js, both on Linux. r=backout a=backout 2017-06-21 19:51:13 +02:00
MozPromise.h Bug 1371982 - Use a RefPtr<> to hold the MozPromise. r=gerald 2017-06-26 20:13:27 -04:00
Mutex.h Bug 1374594 - Allow mutex/monitor scoped unlockers to be constructed from their locking counterparts - r=froydnj 2017-06-20 22:20:49 +12:00
nsEnvironment.cpp Bug 1334278 - change mozilla::Smprintf to return a UniquePtr; r=froydnj 2017-03-03 08:17:27 -07:00
nsEnvironment.h
nsEventQueue.cpp Bug 1331804 - Name each runnable from the ThrottledEventQueue queue (r=bkelly) 2017-01-24 16:34:37 -08:00
nsEventQueue.h Bug 1331804 - Name each runnable from the ThrottledEventQueue queue (r=bkelly) 2017-01-24 16:34:37 -08:00
nsICancelableRunnable.h
nsIEnvironment.idl
nsIEventTarget.idl Bug 1361164 - Add infallible IsOnCurrentThread to nsIEventTarget (r=froydnj) 2017-06-12 20:20:08 -07:00
nsIIdlePeriod.idl
nsIIdleRunnable.h Bug 1358476, add support for timeout when doing idle dispatch, p=farre,smaug, r=nfroyd 2017-05-24 17:34:50 -04:00
nsINamed.idl Bug 1331804 - Measure runnable times keyed by name for telemetry (r=ehsan,bsmedberg) 2017-01-24 16:34:37 -08:00
nsIProcess.idl Bug 1366711 - Make it possible to hide applications launched with nsIProcess; r=bsmedberg 2017-05-22 10:23:00 +02:00
nsIRunnable.idl
nsISerialEventTarget.idl Bug 1372733 - EventTargetFor should return an nsISerialEventTarget (r=bkelly) 2017-06-15 20:16:25 -07:00
nsISupportsPriority.idl
nsIThread.idl Bug 1368072 - Move idle dispatch to thread manager. r=froydnj 2017-06-22 11:14:10 +02:00
nsIThreadInternal.idl Bug 1361164 - Add infallible IsOnCurrentThread to nsIEventTarget (r=froydnj) 2017-06-12 20:20:08 -07:00
nsIThreadManager.idl Bug 1368072 - Move idle dispatch to thread manager. r=froydnj 2017-06-22 11:14:10 +02:00
nsIThreadPool.idl Bug 1361164 - Add infallible IsOnCurrentThread to nsIEventTarget (r=froydnj) 2017-06-12 20:20:08 -07:00
nsITimer.idl Bug 1377222 - Eliminate nsITimer::InitWithFuncCallback in favor of InitWithNamedFuncCallback (r=froydnj) 2017-07-03 16:19:56 -07:00
nsMemoryPressure.cpp Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
nsMemoryPressure.h
nsProcess.h Bug 1366711 - Make it possible to hide applications launched with nsIProcess; r=bsmedberg 2017-05-22 10:23:00 +02:00
nsProcessCommon.cpp Bug 1376638 - Minimize uses of prmem.h. r=glandium. 2017-06-30 19:05:41 -07:00
nsProxyRelease.cpp Bug 1372453 - Part 1: Support to name the callers of ProxyReleaseEvent. r=froydnj 2017-06-13 18:10:13 +08:00
nsProxyRelease.h Bug 1372453 - Part 1: Support to name the callers of ProxyReleaseEvent. r=froydnj 2017-06-13 18:10:13 +08:00
nsThread.cpp Bug 1377344 - Record the name of the currently running Runnable on thread hangs for BHR, r=njn, r=froydnj 2017-07-04 15:16:19 -04:00
nsThread.h Bug 1377344 - Record the name of the currently running Runnable on thread hangs for BHR, r=njn, r=froydnj 2017-07-04 15:16:19 -04:00
nsThreadManager.cpp Bug 1368072 - Move idle dispatch to thread manager. r=froydnj 2017-06-22 11:14:10 +02:00
nsThreadManager.h
nsThreadPool.cpp Bug 1361164 - Add infallible IsOnCurrentThread to nsIEventTarget (r=froydnj) 2017-06-12 20:20:08 -07:00
nsThreadPool.h Bug 1366869 - Make DISPATCH_NORMAL be the default flags argument for nsIEventTarget::Dispatch (r=froydnj) 2017-05-23 12:05:43 -07:00
nsThreadSyncDispatch.h Bug 1363560 - Name more runnables (r=mccr8) 2017-05-09 21:53:25 -07:00
nsThreadUtils.cpp Bug 1372856 - Implement GetName for IdleRunnableWrapper. r=froydnj 2017-06-29 23:55:56 +02:00
nsThreadUtils.h Bug 1372405 - Remove NewRunnable functions that lack a name param (r=froydnj) 2017-06-26 14:19:58 -07:00
nsTimerImpl.cpp Bug 1377222 - Eliminate nsITimer::InitWithFuncCallback in favor of InitWithNamedFuncCallback (r=froydnj) 2017-07-03 16:19:56 -07:00
nsTimerImpl.h Bug 1363829 P12 Expose nsITimer::InitHighResolutionWithCallback() method. r=froydnj 2017-05-31 17:13:19 -07:00
ReentrantMonitor.h Bug 1374594 - Allow mutex/monitor scoped unlockers to be constructed from their locking counterparts - r=froydnj 2017-06-20 22:20:49 +12:00
RWLock.cpp Bug 1367619 - Use RWLock when accessing font prefs service off main thread; r=heycam 2017-05-25 15:04:13 -07:00
RWLock.h Bug 1367619 - Use RWLock when accessing font prefs service off main thread; r=heycam 2017-05-25 15:04:13 -07:00
SchedulerGroup.cpp Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
SchedulerGroup.h Bug 1372733 - EventTargetFor should return an nsISerialEventTarget (r=bkelly) 2017-06-15 20:16:25 -07:00
SharedThreadPool.cpp Bug 1376487 - Use LookupForAdd instead of Get+Put to avoid unnecessary hashtable lookups. r=froydnj 2017-06-28 01:03:17 +02:00
SharedThreadPool.h Bug 1361164 - Add infallible IsOnCurrentThread to nsIEventTarget (r=froydnj) 2017-06-12 20:20:08 -07:00
StateMirroring.h Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
StateWatching.h Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
SyncRunnable.h Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
SystemGroup.cpp Bug 1372733 - EventTargetFor should return an nsISerialEventTarget (r=bkelly) 2017-06-15 20:16:25 -07:00
SystemGroup.h Bug 1372733 - EventTargetFor should return an nsISerialEventTarget (r=bkelly) 2017-06-15 20:16:25 -07:00
TaskCategory.h Bug 1337575 - Use SystemGroup for GC/CC (r=mccr8) 2017-02-13 17:02:59 -08:00
TaskDispatcher.h Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
TaskQueue.cpp Bug 1366072 - Make AbstractThread inherit from nsISerialEventTarget (r=jwwang) 2017-06-13 14:50:58 -07:00
TaskQueue.h Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
ThreadStackHelper.cpp Bug 1377344 - Record the name of the currently running Runnable on thread hangs for BHR, r=njn, r=froydnj 2017-07-04 15:16:19 -04:00
ThreadStackHelper.h Backout Bug 1365309 for test failures on a CLOSED TREE 2017-07-04 17:31:13 -04:00
ThrottledEventQueue.cpp Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
ThrottledEventQueue.h Bug 1372733 - EventTargetFor should return an nsISerialEventTarget (r=bkelly) 2017-06-15 20:16:25 -07:00
TimerThread.cpp Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
TimerThread.h Bug 1365102 - Convert NS_GetCurrentThread uses in xpcom/ (r=froydnj) 2017-06-12 20:21:43 -07:00