Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3808)

Unified Diff: base/threading/platform_thread_win.cc

Issue 1845753006: Don't create redundant ThreadData for Worker Threads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/threading/platform_thread_win.cc
diff --git a/base/threading/platform_thread_win.cc b/base/threading/platform_thread_win.cc
index d5bd9bed08e7978714d989c2a3afcf4a135bed69..214acfe97a660f94bf2f9c81f4b1950a97b55e52 100644
--- a/base/threading/platform_thread_win.cc
+++ b/base/threading/platform_thread_win.cc
@@ -162,7 +162,7 @@ void PlatformThread::Sleep(TimeDelta duration) {
}
// static
-void PlatformThread::SetName(const std::string& name) {
+void PlatformThread::SetName(const std::string& name, bool is_worker_thread) {
ThreadIdNameManager::GetInstance()->SetName(CurrentId(), name);
// On Windows only, we don't need to tell the profiler about the "BrokerEvent"
@@ -172,7 +172,8 @@ void PlatformThread::SetName(const std::string& name) {
// context, including setting up thread local storage, etc. The performance
// impact is not terrible, but there is no reason to do initialize it.
if (name != "BrokerEvent")
- tracked_objects::ThreadData::InitializeThreadContext(name);
+ tracked_objects::ThreadData::InitializeThreadContext(name,
+ is_worker_thread);
// The debugger needs to be around to catch the name in the exception. If
// there isn't a debugger, we are just needlessly throwing an exception.

Powered by Google App Engine
This is Rietveld 408576698