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

Side by Side Diff: mojo/edk/system/waiter.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/waiter.h ('k') | mojo/edk/system/waiter_unittest.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/waiter.h" 5 #include "mojo/edk/system/waiter.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::MutexLocker;
11
10 namespace mojo { 12 namespace mojo {
11 namespace system { 13 namespace system {
12 14
13 Waiter::Waiter() 15 Waiter::Waiter()
14 : 16 :
15 #ifndef NDEBUG 17 #ifndef NDEBUG
16 initialized_(false), 18 initialized_(false),
17 #endif 19 #endif
18 awoken_(false), 20 awoken_(false),
19 awake_result_(MOJO_RESULT_INTERNAL), 21 awake_result_(MOJO_RESULT_INTERNAL),
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 awake_result_ = result; 101 awake_result_ = result;
100 awake_context_ = context; 102 awake_context_ = context;
101 cv_.Signal(); 103 cv_.Signal();
102 // |cv_.Wait()|/|cv_.WaitWithTimeout()| will return after |mutex_| is 104 // |cv_.Wait()|/|cv_.WaitWithTimeout()| will return after |mutex_| is
103 // released. 105 // released.
104 return true; 106 return true;
105 } 107 }
106 108
107 } // namespace system 109 } // namespace system
108 } // namespace mojo 110 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/waiter.h ('k') | mojo/edk/system/waiter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698