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

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

Issue 2135413003: Add |joinable| to Thread::Options (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ignore SetMessageLoop(nullptr) for now -- added TODO Created 4 years, 4 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/debug/alias.h" 9 #include "base/debug/alias.h"
10 #include "base/debug/profiler.h" 10 #include "base/debug/profiler.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 // static 189 // static
190 bool PlatformThread::CreateWithPriority(size_t stack_size, Delegate* delegate, 190 bool PlatformThread::CreateWithPriority(size_t stack_size, Delegate* delegate,
191 PlatformThreadHandle* thread_handle, 191 PlatformThreadHandle* thread_handle,
192 ThreadPriority priority) { 192 ThreadPriority priority) {
193 DCHECK(thread_handle); 193 DCHECK(thread_handle);
194 return CreateThreadInternal(stack_size, delegate, thread_handle, priority); 194 return CreateThreadInternal(stack_size, delegate, thread_handle, priority);
195 } 195 }
196 196
197 // static 197 // static
198 bool PlatformThread::CreateNonJoinable(size_t stack_size, Delegate* delegate) { 198 bool PlatformThread::CreateNonJoinable(size_t stack_size, Delegate* delegate) {
199 return CreateThreadInternal(stack_size, delegate, nullptr, 199 return CreateNonJoinableWithPriority(stack_size, delegate,
200 ThreadPriority::NORMAL); 200 ThreadPriority::NORMAL);
201 } 201 }
202 202
203 // static 203 // static
204 bool PlatformThread::CreateNonJoinableWithPriority(size_t stack_size,
205 Delegate* delegate,
206 ThreadPriority priority) {
207 return CreateThreadInternal(stack_size, delegate, nullptr /* non-joinable */,
208 priority);
209 }
210
211 // static
204 void PlatformThread::Join(PlatformThreadHandle thread_handle) { 212 void PlatformThread::Join(PlatformThreadHandle thread_handle) {
205 DCHECK(thread_handle.platform_handle()); 213 DCHECK(thread_handle.platform_handle());
206 // TODO(willchan): Enable this check once I can get it to work for Windows 214 // TODO(willchan): Enable this check once I can get it to work for Windows
207 // shutdown. 215 // shutdown.
208 // Joining another thread may block the current thread for a long time, since 216 // Joining another thread may block the current thread for a long time, since
209 // the thread referred to by |thread_handle| may still be running long-lived / 217 // the thread referred to by |thread_handle| may still be running long-lived /
210 // blocking tasks. 218 // blocking tasks.
211 #if 0 219 #if 0
212 base::ThreadRestrictions::AssertIOAllowed(); 220 base::ThreadRestrictions::AssertIOAllowed();
213 #endif 221 #endif
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 return ThreadPriority::REALTIME_AUDIO; 283 return ThreadPriority::REALTIME_AUDIO;
276 case THREAD_PRIORITY_ERROR_RETURN: 284 case THREAD_PRIORITY_ERROR_RETURN:
277 DPCHECK(false) << "GetThreadPriority error"; // Falls through. 285 DPCHECK(false) << "GetThreadPriority error"; // Falls through.
278 default: 286 default:
279 NOTREACHED() << "Unexpected priority: " << priority; 287 NOTREACHED() << "Unexpected priority: " << priority;
280 return ThreadPriority::NORMAL; 288 return ThreadPriority::NORMAL;
281 } 289 }
282 } 290 }
283 291
284 } // namespace base 292 } // 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