From db237ad713ffe79491a12b8d88b58bb1d7ae4999 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Thu, 22 Dec 2016 00:14:30 +0100 Subject: [PATCH] Bug 1323100 - Use nsThreadPoolNaming::GetNextThreadName and NS_NewNamedThread in nsThreadPool. r=froydnj MozReview-Commit-ID: 6IB5yvJtAQm --HG-- extra : rebase_source : d4d9bf2dab3e75821e931a11fa0a16f6ee1eb970 --- xpcom/threads/nsThreadPool.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/xpcom/threads/nsThreadPool.cpp b/xpcom/threads/nsThreadPool.cpp index 241fad39dcc2..f1d849ed1a85 100644 --- a/xpcom/threads/nsThreadPool.cpp +++ b/xpcom/threads/nsThreadPool.cpp @@ -104,8 +104,9 @@ nsThreadPool::PutEvent(already_AddRefed aEvent, uint32_t aFlags) } nsCOMPtr thread; - nsThreadManager::get().NewThread(0, stackSize, getter_AddRefs(thread)); - if (NS_WARN_IF(!thread)) { + nsresult rv = NS_NewNamedThread(mThreadNaming.GetNextThreadName(mName), + getter_AddRefs(thread), nullptr, stackSize); + if (NS_WARN_IF(NS_FAILED(rv))) { return NS_ERROR_UNEXPECTED; } @@ -152,8 +153,6 @@ nsThreadPool::ShutdownThread(nsIThread* aThread) NS_IMETHODIMP nsThreadPool::Run() { - mThreadNaming.SetThreadPoolName(mName); - LOG(("THRD-P(%p) enter %s\n", this, mName.BeginReading())); nsCOMPtr current;