Index: base/threading/platform_thread_posix.cc |
diff --git a/base/threading/platform_thread_posix.cc b/base/threading/platform_thread_posix.cc |
index 497acb5efdf7787ea03cace75b0c398931029a0e..9ea0c855d0072d3311f63a8edb7d78fe97567e11 100644 |
--- a/base/threading/platform_thread_posix.cc |
+++ b/base/threading/platform_thread_posix.cc |
@@ -10,6 +10,7 @@ |
#include "base/logging.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/safe_strerror_posix.h" |
+#include "base/debug/trace_event.h" |
#include "base/threading/thread_restrictions.h" |
#if defined(OS_MACOSX) |
@@ -159,6 +160,8 @@ void PlatformThread::Sleep(int duration_ms) { |
#if 0 && defined(OS_LINUX) |
// static |
void PlatformThread::SetName(const char* name) { |
+ base::debug::TraceLog::GetInstance()->SetCurrentThreadName(name); |
+ |
// http://0pointer.de/blog/projects/name-your-threads.html |
// glibc recently added support for pthread_setname_np, but it's not |
@@ -189,8 +192,8 @@ void PlatformThread::SetName(const char* name) { |
// Mac is implemented in platform_thread_mac.mm. |
#else |
// static |
-void PlatformThread::SetName(const char* /*name*/) { |
- // Leave it unimplemented. |
+void PlatformThread::SetName(const char* name) { |
+ base::debug::TraceLog::GetInstance()->SetCurrentThreadName(name); |
// (This should be relatively simple to implement for the BSDs; I |
// just don't have one handy to test the code on.) |