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

Unified Diff: base/threading/platform_thread_win.cc

Issue 1207823004: PlatformThreadHandle: remove public id() interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: the last two nits Created 5 years, 5 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_posix.cc ('k') | base/threading/thread.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 059547b10ed2728d7d80580adf23d31374e11b0d..fab7b9ced2b04cb72336a353f40f968bf129f020 100644
--- a/base/threading/platform_thread_win.cc
+++ b/base/threading/platform_thread_win.cc
@@ -87,12 +87,12 @@ DWORD __stdcall ThreadFunc(void* params) {
PlatformThread::CurrentId());
}
- return NULL;
+ return 0;
}
// CreateThreadInternal() matches PlatformThread::CreateWithPriority(), except
-// that |out_thread_handle| may be NULL, in which case a non-joinable thread is
-// created.
+// that |out_thread_handle| may be nullptr, in which case a non-joinable thread
+// is created.
bool CreateThreadInternal(size_t stack_size,
PlatformThread::Delegate* delegate,
PlatformThreadHandle* out_thread_handle,
@@ -106,7 +106,7 @@ bool CreateThreadInternal(size_t stack_size,
ThreadParams* params = new ThreadParams;
params->delegate = delegate;
- params->joinable = out_thread_handle != NULL;
+ params->joinable = out_thread_handle != nullptr;
params->priority = priority;
// Using CreateThread here vs _beginthreadex makes thread creation a bit
@@ -114,16 +114,15 @@ 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, &thread_id);
+ void* thread_handle =
+ ::CreateThread(nullptr, stack_size, ThreadFunc, params, flags, nullptr);
if (!thread_handle) {
delete params;
return false;
}
if (out_thread_handle)
- *out_thread_handle = PlatformThreadHandle(thread_handle, thread_id);
+ *out_thread_handle = PlatformThreadHandle(thread_handle);
else
CloseHandle(thread_handle);
return true;
@@ -205,8 +204,8 @@ bool PlatformThread::CreateWithPriority(size_t stack_size, Delegate* delegate,
// static
bool PlatformThread::CreateNonJoinable(size_t stack_size, Delegate* delegate) {
- return CreateThreadInternal(
- stack_size, delegate, NULL, ThreadPriority::NORMAL);
+ return CreateThreadInternal(stack_size, delegate, nullptr,
+ ThreadPriority::NORMAL);
}
// static
« no previous file with comments | « base/threading/platform_thread_posix.cc ('k') | base/threading/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698