Bug 1476405: Part 4 - Create nsThread wrappers whenever a thread is registered with the profiler. r=erahm,mstange

This automatically gets us wrappers (and therefore memory statistics) for
Stylo threads, JS HelperThreads, and any other non-nsThread threads that we
already register with the profiler.

MozReview-Commit-ID: 8ZPjb0ojyWp

--HG--
extra : rebase_source : 2d99b864a21ac8f700f9b8686adc4ac14679ef48
extra : intermediate-source : aeebad4f2dc31901f5b63263169229455e827ac2
extra : source : b5b9d295545dff9c8f7aa5e5c0137afa24385eb2
This commit is contained in:
Kris Maglione 2018-07-18 22:39:38 -07:00
Родитель 7c7c5fb182
Коммит 9408c8c02a
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -3298,6 +3298,11 @@ profiler_register_thread(const char* aName, void* aGuessStackTop)
MOZ_ASSERT_IF(NS_IsMainThread(), Scheduler::IsCooperativeThread()); MOZ_ASSERT_IF(NS_IsMainThread(), Scheduler::IsCooperativeThread());
MOZ_RELEASE_ASSERT(CorePS::Exists()); MOZ_RELEASE_ASSERT(CorePS::Exists());
// Make sure we have a nsThread wrapper for the current thread, and that NSPR
// knows its name.
(void) NS_GetCurrentThread();
NS_SetCurrentThreadName(aName);
PSAutoLock lock(gPSMutex); PSAutoLock lock(gPSMutex);
void* stackTop = GetStackTop(aGuessStackTop); void* stackTop = GetStackTop(aGuessStackTop);