Bug 1323100 - Remove nsThreadPoolNaming::SetThreadPoolName because it's now unused. r?froydnj
MozReview-Commit-ID: CYgF2NGD6pt
--- 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;
};
/**