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

Side by Side Diff: base/task_scheduler/scheduler_lock_unittest.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_lock.h" 5 #include "base/task_scheduler/scheduler_lock.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 int acquired_; 49 int acquired_;
50 50
51 DISALLOW_COPY_AND_ASSIGN(BasicLockTestThread); 51 DISALLOW_COPY_AND_ASSIGN(BasicLockTestThread);
52 }; 52 };
53 53
54 class BasicLockAcquireAndWaitThread : public SimpleThread { 54 class BasicLockAcquireAndWaitThread : public SimpleThread {
55 public: 55 public:
56 explicit BasicLockAcquireAndWaitThread(SchedulerLock* lock) 56 explicit BasicLockAcquireAndWaitThread(SchedulerLock* lock)
57 : SimpleThread("BasicLockAcquireAndWaitThread"), 57 : SimpleThread("BasicLockAcquireAndWaitThread"),
58 lock_(lock), 58 lock_(lock),
59 lock_acquire_event_(false, false), 59 lock_acquire_event_(WaitableEvent::ResetPolicy::AUTOMATIC,
60 main_thread_continue_event_(false, false) {} 60 WaitableEvent::InitialState::NOT_SIGNALED),
61 main_thread_continue_event_(WaitableEvent::ResetPolicy::AUTOMATIC,
62 WaitableEvent::InitialState::NOT_SIGNALED) {
63 }
61 64
62 void WaitForLockAcquisition() { 65 void WaitForLockAcquisition() {
63 lock_acquire_event_.Wait(); 66 lock_acquire_event_.Wait();
64 } 67 }
65 68
66 void ContinueMain() { 69 void ContinueMain() {
67 main_thread_continue_event_.Signal(); 70 main_thread_continue_event_.Signal();
68 } 71 }
69 72
70 private: 73 private:
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 SchedulerLock lock4; 287 SchedulerLock lock4;
285 SchedulerLock lock5; 288 SchedulerLock lock5;
286 }; 289 };
287 290
288 EXPECT_DCHECK_DEATH({ LockCycle cycle; }, ""); 291 EXPECT_DCHECK_DEATH({ LockCycle cycle; }, "");
289 } 292 }
290 293
291 } // namespace 294 } // namespace
292 } // namespace internal 295 } // namespace internal
293 } // namespace base 296 } // namespace base
OLDNEW
« no previous file with comments | « base/task_scheduler/priority_queue_unittest.cc ('k') | base/task_scheduler/scheduler_service_thread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698