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

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

Issue 2084593005: Rationalize AddAwakable...() and RemoveAwakable...() methods. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: doh 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
« no previous file with comments | « mojo/edk/system/wait_set_dispatcher.cc ('k') | no next file » | 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_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
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
OLDNEW
« no previous file with comments | « mojo/edk/system/wait_set_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698