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

Unified Diff: base/threading/platform_thread_mac.mm

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: Move the set to PlatformThread::SetName so we catch any name changes. Created 8 years 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_mac.mm
diff --git a/base/threading/platform_thread_mac.mm b/base/threading/platform_thread_mac.mm
index 96c672023f915af3bf93929e7ed557cc6ba1020c..95e6fff58551d23c211f23a042b0173ba7782c09 100644
--- a/base/threading/platform_thread_mac.mm
+++ b/base/threading/platform_thread_mac.mm
@@ -12,6 +12,7 @@
#include "base/lazy_instance.h"
#include "base/logging.h"
+#include "base/threading/thread_id_name_manager.h"
#include "base/threading/thread_local.h"
#include "base/tracked_objects.h"
@@ -50,6 +51,8 @@ void PlatformThread::SetName(const char* name) {
current_thread_name.Pointer()->Set(const_cast<char*>(name));
tracked_objects::ThreadData::InitializeThreadContext(name);
+ ThreadIdNameManager::GetInstance()->SetNameForId(CurrentId(), name);
+
// pthread_setname_np is only available in 10.6 or later, so test
// for it at runtime.
int (*dynamic_pthread_setname_np)(const char*);

Powered by Google App Engine
This is Rietveld 408576698