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

Side by Side Diff: base/threading/platform_thread_win.cc

Issue 1239623003: (not for review): PlatformThreadHandle: remove public id() interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: allow to wait inside thread_id() 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 unified diff | Download patch
« no previous file with comments | « base/threading/platform_thread_posix.cc ('k') | base/threading/thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/threading/platform_thread.h" 5 #include "base/threading/platform_thread.h"
6 6
7 #include "base/debug/alias.h" 7 #include "base/debug/alias.h"
8 #include "base/debug/profiler.h" 8 #include "base/debug/profiler.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/threading/thread_id_name_manager.h" 10 #include "base/threading/thread_id_name_manager.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // http://www.microsoft.com/msj/1099/win32/win321099.aspx 116 // http://www.microsoft.com/msj/1099/win32/win321099.aspx
117 PlatformThreadId thread_id; 117 PlatformThreadId thread_id;
118 void* thread_handle = CreateThread( 118 void* thread_handle = CreateThread(
119 NULL, stack_size, ThreadFunc, params, flags, &thread_id); 119 NULL, stack_size, ThreadFunc, params, flags, &thread_id);
120 if (!thread_handle) { 120 if (!thread_handle) {
121 delete params; 121 delete params;
122 return false; 122 return false;
123 } 123 }
124 124
125 if (out_thread_handle) 125 if (out_thread_handle)
126 *out_thread_handle = PlatformThreadHandle(thread_handle, thread_id); 126 *out_thread_handle = PlatformThreadHandle(thread_handle);
127 else 127 else
128 CloseHandle(thread_handle); 128 CloseHandle(thread_handle);
129 return true; 129 return true;
130 } 130 }
131 131
132 } // namespace 132 } // namespace
133 133
134 // static 134 // static
135 PlatformThreadId PlatformThread::CurrentId() { 135 PlatformThreadId PlatformThread::CurrentId() {
136 return ::GetCurrentThreadId(); 136 return ::GetCurrentThreadId();
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 return ThreadPriority::REALTIME_AUDIO; 281 return ThreadPriority::REALTIME_AUDIO;
282 case THREAD_PRIORITY_ERROR_RETURN: 282 case THREAD_PRIORITY_ERROR_RETURN:
283 DPCHECK(false) << "GetThreadPriority error"; // Falls through. 283 DPCHECK(false) << "GetThreadPriority error"; // Falls through.
284 default: 284 default:
285 NOTREACHED() << "Unexpected priority: " << priority; 285 NOTREACHED() << "Unexpected priority: " << priority;
286 return ThreadPriority::NORMAL; 286 return ThreadPriority::NORMAL;
287 } 287 }
288 } 288 }
289 289
290 } // namespace base 290 } // namespace base
OLDNEW
« 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