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

Unified Diff: base/threading/platform_thread_win.cc

Issue 11438022: Add ability to retrieve a thread_name given a thread_id. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make some of the try servers happier. Created 7 years, 11 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
« no previous file with comments | « base/threading/platform_thread_posix.cc ('k') | base/threading/thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/platform_thread_win.cc
diff --git a/base/threading/platform_thread_win.cc b/base/threading/platform_thread_win.cc
index 82981adaf834b7a813cabf40756f4c2d59222ac5..9e877b32f9e1e630ce31c164f5e58680b898e5f7 100644
--- a/base/threading/platform_thread_win.cc
+++ b/base/threading/platform_thread_win.cc
@@ -7,7 +7,7 @@
#include "base/debug/alias.h"
#include "base/debug/profiler.h"
#include "base/logging.h"
-#include "base/threading/thread_local.h"
+#include "base/threading/thread_id_name_manager.h"
#include "base/threading/thread_restrictions.h"
#include "base/tracked_objects.h"
@@ -17,8 +17,6 @@ namespace base {
namespace {
-static ThreadLocalPointer<char> current_thread_name;
-
// The information on how to set the thread name comes from
// a MSDN article: http://msdn2.microsoft.com/en-us/library/xcb2z8hs.aspx
const DWORD kVCThreadNameException = 0x406D1388;
@@ -116,7 +114,7 @@ void PlatformThread::Sleep(TimeDelta duration) {
// static
void PlatformThread::SetName(const char* name) {
- current_thread_name.Set(const_cast<char*>(name));
+ ThreadIdNameManager::GetInstance()->SetName(CurrentId(), name);
// On Windows only, we don't need to tell the profiler about the "BrokerEvent"
// thread, as it exists only in the chrome.exe image, and never spawns or runs
@@ -139,7 +137,7 @@ void PlatformThread::SetName(const char* name) {
// static
const char* PlatformThread::GetName() {
- return current_thread_name.Get();
+ return ThreadIdNameManager::GetInstance()->GetName(CurrentId());
}
// static
« no previous file with comments | « base/threading/platform_thread_posix.cc ('k') | base/threading/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698