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

Side by Side Diff: base/task_scheduler/scheduler_worker_thread.cc

Issue 2032603002: Migrate WaitableEvent to enum-based constructor in base/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@WEvent_enums
Patch Set: undo incorrect template change Created 4 years, 6 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
OLDNEW
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 29 matching lines...) Expand all
40 AutoSchedulerLock auto_lock(should_exit_for_testing_lock_); 40 AutoSchedulerLock auto_lock(should_exit_for_testing_lock_);
41 should_exit_for_testing_ = true; 41 should_exit_for_testing_ = true;
42 } 42 }
43 WakeUp(); 43 WakeUp();
44 PlatformThread::Join(thread_handle_); 44 PlatformThread::Join(thread_handle_);
45 } 45 }
46 46
47 SchedulerWorkerThread::SchedulerWorkerThread(ThreadPriority thread_priority, 47 SchedulerWorkerThread::SchedulerWorkerThread(ThreadPriority thread_priority,
48 std::unique_ptr<Delegate> delegate, 48 std::unique_ptr<Delegate> delegate,
49 TaskTracker* task_tracker) 49 TaskTracker* task_tracker)
50 : wake_up_event_(false, false), 50 : wake_up_event_(WaitableEvent::ResetPolicy::AUTOMATIC,
51 WaitableEvent::InitialState::NOT_SIGNALED),
51 delegate_(std::move(delegate)), 52 delegate_(std::move(delegate)),
52 task_tracker_(task_tracker) { 53 task_tracker_(task_tracker) {
53 DCHECK(delegate_); 54 DCHECK(delegate_);
54 DCHECK(task_tracker_); 55 DCHECK(task_tracker_);
55 56
56 const size_t kDefaultStackSize = 0; 57 const size_t kDefaultStackSize = 0;
57 PlatformThread::CreateWithPriority(kDefaultStackSize, this, &thread_handle_, 58 PlatformThread::CreateWithPriority(kDefaultStackSize, this, &thread_handle_,
58 thread_priority); 59 thread_priority);
59 } 60 }
60 61
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 } 102 }
102 } 103 }
103 104
104 bool SchedulerWorkerThread::ShouldExitForTesting() const { 105 bool SchedulerWorkerThread::ShouldExitForTesting() const {
105 AutoSchedulerLock auto_lock(should_exit_for_testing_lock_); 106 AutoSchedulerLock auto_lock(should_exit_for_testing_lock_);
106 return should_exit_for_testing_; 107 return should_exit_for_testing_;
107 } 108 }
108 109
109 } // namespace internal 110 } // namespace internal
110 } // namespace base 111 } // namespace base
OLDNEW
« no previous file with comments | « base/task_scheduler/scheduler_thread_pool_impl_unittest.cc ('k') | base/task_scheduler/scheduler_worker_thread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698