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

Unified Diff: base/threading/platform_thread.h

Issue 7495031: trace_event support for thread names (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaks to pass all trybots. Created 9 years, 4 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.h
diff --git a/base/threading/platform_thread.h b/base/threading/platform_thread.h
index 230d2099f7b92ed222333f794334e9f643150d1f..f07bd47e168bc6174313583b072bf7eb6b68fe7d 100644
--- a/base/threading/platform_thread.h
+++ b/base/threading/platform_thread.h
@@ -74,9 +74,14 @@ class BASE_API PlatformThread {
// Sleeps for the specified duration (units are milliseconds).
static void Sleep(int duration_ms);
- // Sets the thread name visible to a debugger. This has no effect otherwise.
+ // Sets the thread name visible to debuggers/tools. This has no effect
+ // otherwise. This name pointer is not copied internally. Thus, it must stay
+ // valid until the thread ends.
static void SetName(const char* name);
+ // Gets the thread name, if previously set by SetName.
+ static const char* GetName();
+
// Creates a new thread. The |stack_size| parameter can be 0 to indicate
// that the default stack size should be used. Upon success,
// |*thread_handle| will be assigned a handle to the newly created thread,

Powered by Google App Engine
This is Rietveld 408576698