Bug 1728866 - Remove the word 'thread' from TaskController thread names, r=bas.

Differential Revision: https://phabricator.services.mozilla.com/D124389
This commit is contained in:
Florian Quèze 2021-09-09 20:21:45 +00:00
Родитель 5f03e76d19
Коммит 33aef3e03c
1 изменённых файлов: 1 добавлений и 25 удалений

Просмотреть файл

@ -29,11 +29,6 @@
# include "objbase.h"
#endif
#ifdef XP_WIN
typedef HRESULT(WINAPI* SetThreadDescriptionPtr)(HANDLE hThread,
PCWSTR lpThreadDescription);
#endif
namespace mozilla {
std::unique_ptr<TaskController> TaskController::sSingleton;
@ -123,10 +118,6 @@ void ThreadFuncPoolThread(void* aIndex) {
TaskController::Get()->RunPoolThread();
}
#ifdef XP_WIN
static SetThreadDescriptionPtr sSetThreadDescriptionFunc = nullptr;
#endif
bool TaskController::InitializeInternal() {
InputTaskManager::Init();
VsyncTaskManager::Init();
@ -137,12 +128,6 @@ bool TaskController::InitializeInternal() {
"TaskController::ExecutePendingMTTasks()",
[]() { TaskController::Get()->ProcessPendingMTTask(true); });
#ifdef XP_WIN
sSetThreadDescriptionFunc =
reinterpret_cast<SetThreadDescriptionPtr>(::GetProcAddress(
::GetModuleHandle(L"Kernel32.dll"), "SetThreadDescription"));
#endif
return true;
}
@ -228,20 +213,11 @@ void TaskController::RunPoolThread() {
RefPtr<Task> lastTask;
#ifdef XP_WIN
nsAutoString threadWName;
threadWName.AppendLiteral(u"TaskController Thread #");
threadWName.AppendInt(static_cast<int64_t>(mThreadPoolIndex));
if (sSetThreadDescriptionFunc) {
sSetThreadDescriptionFunc(
::GetCurrentThread(),
reinterpret_cast<const WCHAR*>(threadWName.BeginReading()));
}
::CoInitializeEx(nullptr, COINIT_MULTITHREADED);
#endif
nsAutoCString threadName;
threadName.AppendLiteral("TaskController Thread #");
threadName.AppendLiteral("TaskController #");
threadName.AppendInt(static_cast<int64_t>(mThreadPoolIndex));
AUTO_PROFILER_REGISTER_THREAD(threadName.BeginReading());