Bug 1347007 - Register with the profiler after doing so for the ThreadManager. r=njn

MozReview-Commit-ID: 6gtDxmlgOta

--HG--
extra : rebase_source : 782ce4a783c393f809ffca1d0ab2c48daefbac92
This commit is contained in:
Blake Kaplan 2017-03-13 15:03:24 -07:00
Родитель 84c2879b84
Коммит 42aa6054b3
1 изменённых файлов: 8 добавлений и 3 удалений

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

@ -460,10 +460,8 @@ nsThread::ThreadFunc(void* aArg)
self->mThread = PR_GetCurrentThread();
SetupCurrentThreadForChaosMode();
if (initData->name.Length() > 0) {
if (!initData->name.IsEmpty()) {
PR_SetCurrentThreadName(initData->name.BeginReading());
profiler_register_thread(initData->name.BeginReading(), &stackTop);
}
// Inform the ThreadManager
@ -471,6 +469,13 @@ nsThread::ThreadFunc(void* aArg)
mozilla::IOInterposer::RegisterCurrentThread();
// This must come after the call to nsThreadManager::RegisterCurrentThread(),
// because that call is needed to properly set up this thread as an nsThread,
// which profiler_register_thread() requires. See bug 1347007.
if (!initData->name.IsEmpty()) {
profiler_register_thread(initData->name.BeginReading(), &stackTop);
}
// Wait for and process startup event
nsCOMPtr<nsIRunnable> event;
{