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

Unified Diff: base/threading/platform_thread_win.cc

Issue 1011683002: Lazily initialize MessageLoop for faster thread startup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: non-blocking thread_id() Created 5 years, 9 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_win.cc
diff --git a/base/threading/platform_thread_win.cc b/base/threading/platform_thread_win.cc
index 3df371943f5e6fdf1a91175802b7fb36f78d9aba..6e488a2f8a13bf7f92fc078f4a0fdfbca980297c 100644
--- a/base/threading/platform_thread_win.cc
+++ b/base/threading/platform_thread_win.cc
@@ -108,17 +108,19 @@ 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);
- else
+ if (out_thread_handle) {
rvargas (doing something else) 2015/03/26 02:19:27 nit: no need for {}
kinuko 2015/04/13 02:02:59 Done.
+ *out_thread_handle = PlatformThreadHandle(thread_handle, thread_id);
+ } else {
CloseHandle(thread_handle);
+ }
return true;
}

Powered by Google App Engine
This is Rietveld 408576698