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

Unified Diff: base/threading/platform_thread_linux.cc

Issue 1128733002: Update from https://crrev.com/328418 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « base/threading/platform_thread_freebsd.cc ('k') | base/threading/platform_thread_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/platform_thread_linux.cc
diff --git a/base/threading/platform_thread_linux.cc b/base/threading/platform_thread_linux.cc
index b72fb5bb24b499bc1cac4faf72ac99b7b8be5c28..9f7437418a7299ec6ab92d80b1be6735f6b9b9fa 100644
--- a/base/threading/platform_thread_linux.cc
+++ b/base/threading/platform_thread_linux.cc
@@ -70,7 +70,7 @@ bool GetThreadPriorityForPlatform(PlatformThreadHandle handle,
} // namespace internal
// static
-void PlatformThread::SetName(const char* name) {
+void PlatformThread::SetName(const std::string& name) {
ThreadIdNameManager::GetInstance()->SetName(CurrentId(), name);
tracked_objects::ThreadData::InitializeThreadContext(name);
@@ -87,7 +87,7 @@ void PlatformThread::SetName(const char* name) {
// Note that glibc also has a 'pthread_setname_np' api, but it may not be
// available everywhere and it's only benefit over using prctl directly is
// that it can set the name of threads other than the current thread.
- int err = prctl(PR_SET_NAME, name);
+ int err = prctl(PR_SET_NAME, name.c_str());
// We expect EPERM failures in sandboxed processes, just ignore those.
if (err < 0 && errno != EPERM)
DPLOG(ERROR) << "prctl(PR_SET_NAME)";
« no previous file with comments | « base/threading/platform_thread_freebsd.cc ('k') | base/threading/platform_thread_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698