OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/task_scheduler/scheduler_worker.h" | 5 #include "base/task_scheduler/scheduler_worker.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 outer_->delegate_->OnMainEntry(outer_); | 41 outer_->delegate_->OnMainEntry(outer_); |
42 | 42 |
43 // A SchedulerWorker starts out waiting for work. | 43 // A SchedulerWorker starts out waiting for work. |
44 WaitForWork(); | 44 WaitForWork(); |
45 | 45 |
46 #if defined(OS_WIN) | 46 #if defined(OS_WIN) |
47 // This is required as SequencedWorkerPool previously blindly CoInitialized | 47 // This is required as SequencedWorkerPool previously blindly CoInitialized |
48 // all of its threads. | 48 // all of its threads. |
49 // TODO: Get rid of this broad COM scope and force tasks that care about a | 49 // TODO: Get rid of this broad COM scope and force tasks that care about a |
50 // CoInitialized environment to request one (via an upcoming ExecutionMode). | 50 // CoInitialized environment to request one (via an upcoming execution |
| 51 // mode). |
51 win::ScopedCOMInitializer com_initializer; | 52 win::ScopedCOMInitializer com_initializer; |
52 #endif | 53 #endif |
53 | 54 |
54 while (!outer_->task_tracker_->IsShutdownComplete() && | 55 while (!outer_->task_tracker_->IsShutdownComplete() && |
55 !outer_->should_exit_for_testing_.IsSet()) { | 56 !outer_->should_exit_for_testing_.IsSet()) { |
56 DCHECK(outer_); | 57 DCHECK(outer_); |
57 | 58 |
58 #if defined(OS_MACOSX) | 59 #if defined(OS_MACOSX) |
59 mac::ScopedNSAutoreleasePool autorelease_pool; | 60 mac::ScopedNSAutoreleasePool autorelease_pool; |
60 #endif | 61 #endif |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 thread_ = Thread::Create(this); | 276 thread_ = Thread::Create(this); |
276 } | 277 } |
277 | 278 |
278 void SchedulerWorker::CreateThreadAssertSynchronized() { | 279 void SchedulerWorker::CreateThreadAssertSynchronized() { |
279 thread_lock_.AssertAcquired(); | 280 thread_lock_.AssertAcquired(); |
280 CreateThread(); | 281 CreateThread(); |
281 } | 282 } |
282 | 283 |
283 } // namespace internal | 284 } // namespace internal |
284 } // namespace base | 285 } // namespace base |
OLD | NEW |