Chromium Code Reviews| 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_thread.h" | 5 #include "base/task_scheduler/scheduler_worker_thread.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 | 24 |
| 25 if (worker_thread->thread_handle_.is_null()) | 25 if (worker_thread->thread_handle_.is_null()) |
| 26 return nullptr; | 26 return nullptr; |
| 27 return worker_thread; | 27 return worker_thread; |
| 28 } | 28 } |
| 29 | 29 |
| 30 SchedulerWorkerThread::~SchedulerWorkerThread() { | 30 SchedulerWorkerThread::~SchedulerWorkerThread() { |
| 31 DCHECK(ShouldExitForTesting()); | 31 DCHECK(ShouldExitForTesting()); |
| 32 } | 32 } |
| 33 | 33 |
| 34 std::string SchedulerWorkerThread::GetThreadName() const { | |
| 35 return std::string(); | |
|
gab
2016/05/12 15:50:56
This is wrong, these threads do have a name (set h
| |
| 36 } | |
| 37 | |
| 34 void SchedulerWorkerThread::WakeUp() { | 38 void SchedulerWorkerThread::WakeUp() { |
| 35 wake_up_event_.Signal(); | 39 wake_up_event_.Signal(); |
| 36 } | 40 } |
| 37 | 41 |
| 38 void SchedulerWorkerThread::JoinForTesting() { | 42 void SchedulerWorkerThread::JoinForTesting() { |
| 39 { | 43 { |
| 40 AutoSchedulerLock auto_lock(should_exit_for_testing_lock_); | 44 AutoSchedulerLock auto_lock(should_exit_for_testing_lock_); |
| 41 should_exit_for_testing_ = true; | 45 should_exit_for_testing_ = true; |
| 42 } | 46 } |
| 43 WakeUp(); | 47 WakeUp(); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 } | 98 } |
| 95 } | 99 } |
| 96 | 100 |
| 97 bool SchedulerWorkerThread::ShouldExitForTesting() const { | 101 bool SchedulerWorkerThread::ShouldExitForTesting() const { |
| 98 AutoSchedulerLock auto_lock(should_exit_for_testing_lock_); | 102 AutoSchedulerLock auto_lock(should_exit_for_testing_lock_); |
| 99 return should_exit_for_testing_; | 103 return should_exit_for_testing_; |
| 100 } | 104 } |
| 101 | 105 |
| 102 } // namespace internal | 106 } // namespace internal |
| 103 } // namespace base | 107 } // namespace base |
| OLD | NEW |