Bug 1323100 - Remove NS_SetThreadName which is now unused. r=froydnj

MozReview-Commit-ID: 7je5PhV1TsU

--HG--
extra : rebase_source : 74a4339b3c7338e85caf9287b225d75a556b2938
This commit is contained in:
Markus Stange 2016-12-20 14:43:11 +01:00
parent b289e8b136
commit ce1d36ccc8
2 changed files with 0 additions and 68 deletions

View File

@ -390,56 +390,6 @@ NS_ProcessNextEvent(nsIThread* aThread, bool aMayWait)
return NS_SUCCEEDED(aThread->ProcessNextEvent(aMayWait, &val)) && val;
}
#ifndef XPCOM_GLUE_AVOID_NSPR
namespace {
class nsNameThreadRunnable final : public nsIRunnable
{
~nsNameThreadRunnable() {}
public:
explicit nsNameThreadRunnable(const nsACString& aName) : mName(aName) {}
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIRUNNABLE
protected:
const nsCString mName;
};
NS_IMPL_ISUPPORTS(nsNameThreadRunnable, nsIRunnable)
NS_IMETHODIMP
nsNameThreadRunnable::Run()
{
PR_SetCurrentThreadName(mName.BeginReading());
return NS_OK;
}
} // namespace
void
NS_SetThreadName(nsIThread* aThread, const nsACString& aName)
{
if (!aThread) {
return;
}
aThread->Dispatch(new nsNameThreadRunnable(aName),
nsIEventTarget::DISPATCH_NORMAL);
}
#else // !XPCOM_GLUE_AVOID_NSPR
void
NS_SetThreadName(nsIThread* aThread, const nsACString& aName)
{
// No NSPR, no love.
}
#endif
#ifdef MOZILLA_INTERNAL_API
nsIThread*
NS_GetCurrentThread()

View File

@ -32,24 +32,6 @@
// These methods are alternatives to the methods on nsIThreadManager, provided
// for convenience.
/**
* Set name of the target thread. This operation is asynchronous.
*/
extern void NS_SetThreadName(nsIThread* aThread, const nsACString& aName);
/**
* Static length version of the above function checking length of the
* name at compile time.
*/
template<size_t LEN>
inline void
NS_SetThreadName(nsIThread* aThread, const char (&aName)[LEN])
{
static_assert(LEN <= 16,
"Thread name must be no more than 16 characters");
NS_SetThreadName(aThread, nsDependentCString(aName));
}
/**
* Create a new thread, and optionally provide an initial event for the thread.
*