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

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

Issue 2068483002: Add an unconditional version of DispatcherAddAwakable(): AddAwakableUnconditional(). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: oops 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/message_pipe_endpoint.cc ('k') | mojo/edk/system/message_pipe_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/message_pipe_test_utils.h" 5 #include "mojo/edk/system/message_pipe_test_utils.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "mojo/edk/embedder/simple_platform_support.h" 9 #include "mojo/edk/embedder/simple_platform_support.h"
10 #include "mojo/edk/platform/thread_utils.h" 10 #include "mojo/edk/platform/thread_utils.h"
(...skipping 12 matching lines...) Expand all
23 namespace system { 23 namespace system {
24 namespace test { 24 namespace test {
25 25
26 MojoResult WaitIfNecessary(MessagePipe* mp, 26 MojoResult WaitIfNecessary(MessagePipe* mp,
27 MojoHandleSignals signals, 27 MojoHandleSignals signals,
28 HandleSignalsState* signals_state) { 28 HandleSignalsState* signals_state) {
29 Waiter waiter; 29 Waiter waiter;
30 waiter.Init(); 30 waiter.Init();
31 31
32 MojoResult add_result = 32 MojoResult add_result =
33 mp->AddAwakable(0, &waiter, signals, 0, signals_state); 33 mp->AddAwakable(0, &waiter, signals, false, 0, signals_state);
34 if (add_result != MOJO_RESULT_OK) { 34 if (add_result != MOJO_RESULT_OK) {
35 return (add_result == MOJO_RESULT_ALREADY_EXISTS) ? MOJO_RESULT_OK 35 return (add_result == MOJO_RESULT_ALREADY_EXISTS) ? MOJO_RESULT_OK
36 : add_result; 36 : add_result;
37 } 37 }
38 38
39 MojoResult wait_result = waiter.Wait(MOJO_DEADLINE_INDEFINITE, nullptr); 39 MojoResult wait_result = waiter.Wait(MOJO_DEADLINE_INDEFINITE, nullptr);
40 mp->RemoveAwakable(0, &waiter, signals_state); 40 mp->RemoveAwakable(0, &waiter, signals_state);
41 return wait_result; 41 return wait_result;
42 } 42 }
43 43
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } 108 }
109 109
110 void MultiprocessMessagePipeTestBase::Init(RefPtr<ChannelEndpoint>&& ep) { 110 void MultiprocessMessagePipeTestBase::Init(RefPtr<ChannelEndpoint>&& ep) {
111 channel_thread_.Start(helper_.server_platform_handle.Pass(), std::move(ep)); 111 channel_thread_.Start(helper_.server_platform_handle.Pass(), std::move(ep));
112 } 112 }
113 #endif // !defined(OS_IOS) 113 #endif // !defined(OS_IOS)
114 114
115 } // namespace test 115 } // namespace test
116 } // namespace system 116 } // namespace system
117 } // namespace mojo 117 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/message_pipe_endpoint.cc ('k') | mojo/edk/system/message_pipe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698