| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |