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

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: update comment Created 4 years, 7 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..8fb34076ed8e4a27fda869a52e71fef23a59a5ba 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"
@@ -171,7 +171,7 @@ void PlatformThread::SetName(const std::string& name) {
// which would also (as a side effect) initialize the profiler in this unused
// 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")
+ if (name != "BrokerEvent" && !is_worker_thread)
tracked_objects::ThreadData::InitializeThreadContext(name);
// The debugger needs to be around to catch the name in the exception. If

Powered by Google App Engine
This is Rietveld 408576698