mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 20:30:41 +00:00
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:
parent
f7a18ffd6a
commit
83a9b3b26b
@ -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()
|
||||
|
@ -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.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user