| 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_test_utils.h" | 5 #include "mojo/edk/system/waiter_test_utils.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 using mojo::util::RefPtr; | 9 using mojo::util::RefPtr; |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 *signals_state_out_ = HandleSignalsState(~0u, ~0u); | 51 *signals_state_out_ = HandleSignalsState(~0u, ~0u); |
| 52 } | 52 } |
| 53 | 53 |
| 54 WaiterThread::~WaiterThread() { | 54 WaiterThread::~WaiterThread() { |
| 55 Join(); | 55 Join(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void WaiterThread::Run() { | 58 void WaiterThread::Run() { |
| 59 waiter_.Init(); | 59 waiter_.Init(); |
| 60 | 60 |
| 61 *result_out_ = dispatcher_->AddAwakable(&waiter_, handle_signals_, context_, | 61 *result_out_ = dispatcher_->AddAwakable(&waiter_, context_, false, |
| 62 signals_state_out_); | 62 handle_signals_, signals_state_out_); |
| 63 if (*result_out_ != MOJO_RESULT_OK) | 63 if (*result_out_ != MOJO_RESULT_OK) |
| 64 return; | 64 return; |
| 65 | 65 |
| 66 *did_wait_out_ = true; | 66 *did_wait_out_ = true; |
| 67 *result_out_ = waiter_.Wait(deadline_, context_out_, nullptr); | 67 *result_out_ = waiter_.Wait(deadline_, context_out_, nullptr); |
| 68 dispatcher_->RemoveAwakable(&waiter_, signals_state_out_); | 68 dispatcher_->RemoveAwakable(false, &waiter_, 0, signals_state_out_); |
| 69 } | 69 } |
| 70 | 70 |
| 71 } // namespace test | 71 } // namespace test |
| 72 } // namespace system | 72 } // namespace system |
| 73 } // namespace mojo | 73 } // namespace mojo |
| OLD | NEW |