Bug 1323100 - Remove nsThreadPoolNaming::SetThreadPoolName because it's now unused. r?froydnj draft
authorMarkus Stange <mstange@themasta.com>
Mon, 19 Dec 2016 16:16:50 +0100
changeset 456883 05bdf050aba962bb73537e11c1f05efea6018a5a
parent 456882 bcfc0da955f501f0c4c7747c36f5af75f622bc3e
child 456884 bd93ef94d0b494db38464df65ed14a0c000b639c
push id40636
push userbmo:mstange@themasta.com
push dateFri, 06 Jan 2017 12:38:48 +0000
reviewersfroydnj
bugs1323100
milestone53.0a1
Bug 1323100 - Remove nsThreadPoolNaming::SetThreadPoolName because it's now unused. r?froydnj MozReview-Commit-ID: CYgF2NGD6pt
xpcom/glue/nsThreadUtils.cpp
xpcom/glue/nsThreadUtils.h
--- a/xpcom/glue/nsThreadUtils.cpp
+++ b/xpcom/glue/nsThreadUtils.cpp
@@ -443,33 +443,16 @@ NS_GetCurrentThread()
 nsCString
 nsThreadPoolNaming::GetNextThreadName(const nsACString& aPoolName)
 {
   nsCString name(aPoolName);
   name.AppendLiteral(" #");
   name.AppendInt(++mCounter, 10); // The counter is declared as atomic
   return name;
 }
- 
-void
-nsThreadPoolNaming::SetThreadPoolName(const nsACString& aPoolName,
-                                      nsIThread* aThread)
-{
-  nsCString name = GetNextThreadName(aPoolName);
-
-  if (aThread) {
-    // Set on the target thread
-    NS_SetThreadName(aThread, name);
-  } else {
-    // Set on the current thread
-#ifndef XPCOM_GLUE_AVOID_NSPR
-    PR_SetCurrentThreadName(name.BeginReading());
-#endif
-  }
-}
 
 // nsAutoLowPriorityIO
 nsAutoLowPriorityIO::nsAutoLowPriorityIO()
 {
 #if defined(XP_WIN)
   lowIOPrioritySet = IsVistaOrLater() &&
                      SetThreadPriority(GetCurrentThread(),
                                        THREAD_MODE_BACKGROUND_BEGIN);
--- a/xpcom/glue/nsThreadUtils.h
+++ b/xpcom/glue/nsThreadUtils.h
@@ -1043,24 +1043,16 @@ public:
   nsCString GetNextThreadName(const nsACString& aPoolName);
 
   template<size_t LEN>
   nsCString GetNextThreadName(const char (&aPoolName)[LEN])
   {
     return GetNextThreadName(nsDependentCString(aPoolName, LEN - 1));
   }
 
-  /**
-   * Creates and sets next thread name as "<aPoolName> #<n>"
-   * on the specified thread.  If no thread is specified (aThread
-   * is null) then the name is synchronously set on the current thread.
-   */
-  void SetThreadPoolName(const nsACString& aPoolName,
-                         nsIThread* aThread = nullptr);
-
 private:
   mozilla::Atomic<uint32_t> mCounter;
 
   nsThreadPoolNaming(const nsThreadPoolNaming&) = delete;
   void operator=(const nsThreadPoolNaming&) = delete;
 };
 
 /**