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

Unified Diff: base/threading/platform_thread_win.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_mac.mm ('k') | base/threading/post_task_and_reply_impl.h » ('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 b9f7a5648ad3ff2350e12e728a28a7158f75bac3..aeaa7c7a720e70886a76bedad41c25be073b41df 100644
--- a/base/threading/platform_thread_win.cc
+++ b/base/threading/platform_thread_win.cc
@@ -108,15 +108,16 @@ bool CreateThreadInternal(size_t stack_size,
// have to work running on CreateThread() threads anyway, since we run code
// on the Windows thread pool, etc. For some background on the difference:
// http://www.microsoft.com/msj/1099/win32/win321099.aspx
+ PlatformThreadId thread_id;
void* thread_handle = CreateThread(
- NULL, stack_size, ThreadFunc, params, flags, NULL);
+ NULL, stack_size, ThreadFunc, params, flags, &thread_id);
if (!thread_handle) {
delete params;
return false;
}
if (out_thread_handle)
- *out_thread_handle = PlatformThreadHandle(thread_handle);
+ *out_thread_handle = PlatformThreadHandle(thread_handle, thread_id);
else
CloseHandle(thread_handle);
return true;
@@ -154,7 +155,7 @@ void PlatformThread::Sleep(TimeDelta duration) {
}
// static
-void PlatformThread::SetName(const char* name) {
+void PlatformThread::SetName(const std::string& name) {
ThreadIdNameManager::GetInstance()->SetName(CurrentId(), name);
// On Windows only, we don't need to tell the profiler about the "BrokerEvent"
@@ -163,7 +164,7 @@ void PlatformThread::SetName(const char* name) {
// which would also (as a side effect) initialize the profiler in this unused
// context, including setting up thread local storage, etc. The performance
// impact is not terrible, but there is no reason to do initialize it.
- if (0 != strcmp(name, "BrokerEvent"))
+ if (name != "BrokerEvent")
tracked_objects::ThreadData::InitializeThreadContext(name);
// The debugger needs to be around to catch the name in the exception. If
@@ -173,7 +174,7 @@ void PlatformThread::SetName(const char* name) {
if (!::IsDebuggerPresent() && !base::debug::IsBinaryInstrumented())
return;
- SetNameInternal(CurrentId(), name);
+ SetNameInternal(CurrentId(), name.c_str());
}
// static
« no previous file with comments | « base/threading/platform_thread_mac.mm ('k') | base/threading/post_task_and_reply_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698