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

Side by Side Diff: mojo/edk/system/waitable_event.cc

Issue 1426343002: EDK: Move mutex.*, cond_var.*, and thread_annotations.h to //mojo/edk/util. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: oops Created 5 years, 1 month 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 | « mojo/edk/system/waitable_event.h ('k') | mojo/edk/system/waiter.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "mojo/edk/system/waitable_event.h" 5 #include "mojo/edk/system/waitable_event.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 9
10 using mojo::util::CondVar;
11 using mojo::util::Mutex;
12 using mojo::util::MutexLocker;
13
10 namespace mojo { 14 namespace mojo {
11 namespace system { 15 namespace system {
12 16
13 namespace { 17 namespace {
14 18
15 // Waits with a timeout on |condition()|. Returns true on timeout, or false if 19 // Waits with a timeout on |condition()|. Returns true on timeout, or false if
16 // |condition()| ever returns true. |condition()| should have no side effects 20 // |condition()| ever returns true. |condition()| should have no side effects
17 // (and will always be called with |*mutex| held). 21 // (and will always be called with |*mutex| held).
18 template <typename ConditionFn> 22 template <typename ConditionFn>
19 bool WaitWithTimeoutImpl(Mutex* mutex, 23 bool WaitWithTimeoutImpl(Mutex* mutex,
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 return rv; 159 return rv;
156 } 160 }
157 161
158 bool ManualResetWaitableEvent::IsSignaledForTest() { 162 bool ManualResetWaitableEvent::IsSignaledForTest() {
159 MutexLocker locker(&mutex_); 163 MutexLocker locker(&mutex_);
160 return signaled_; 164 return signaled_;
161 } 165 }
162 166
163 } // namespace system 167 } // namespace system
164 } // namespace mojo 168 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/waitable_event.h ('k') | mojo/edk/system/waiter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698