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

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

Issue 2100553002: Add Core methods for wait set. (Closed) Base URL: https://github.com/domokit/mojo.git@work790_wait_set_5.4
Patch Set: 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.h ('k') | mojo/edk/system/wait_set_dispatcher_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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/wait_set_dispatcher.h" 5 #include "mojo/edk/system/wait_set_dispatcher.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 RefPtr<Dispatcher> 145 RefPtr<Dispatcher>
146 WaitSetDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock( 146 WaitSetDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock(
147 MessagePipe* /*message_pipe*/, 147 MessagePipe* /*message_pipe*/,
148 unsigned /*port*/) { 148 unsigned /*port*/) {
149 mutex().AssertHeld(); 149 mutex().AssertHeld();
150 NOTREACHED(); 150 NOTREACHED();
151 return nullptr; 151 return nullptr;
152 } 152 }
153 153
154 MojoResult WaitSetDispatcher::WaitSetAddImpl( 154 MojoResult WaitSetDispatcher::WaitSetAddImpl(
155 UserPointer<const MojoWaitSetAddOptions> options,
156 RefPtr<Dispatcher>&& dispatcher, 155 RefPtr<Dispatcher>&& dispatcher,
157 MojoHandleSignals signals, 156 MojoHandleSignals signals,
158 uint64_t cookie) { 157 uint64_t cookie,
158 UserPointer<const MojoWaitSetAddOptions> options) {
159 // This will be owned by |entries_|, so it should only be used under 159 // This will be owned by |entries_|, so it should only be used under
160 // |mutex()|. 160 // |mutex()|.
161 Entry* entry = nullptr; 161 Entry* entry = nullptr;
162 { 162 {
163 MutexLocker locker(&mutex()); 163 MutexLocker locker(&mutex());
164 if (is_closed_no_lock()) 164 if (is_closed_no_lock())
165 return MOJO_RESULT_INVALID_ARGUMENT; 165 return MOJO_RESULT_INVALID_ARGUMENT;
166 MojoWaitSetAddOptions validated_options; 166 MojoWaitSetAddOptions validated_options;
167 MojoResult result = ValidateWaitSetAddOptions(options, &validated_options); 167 MojoResult result = ValidateWaitSetAddOptions(options, &validated_options);
168 if (result != MOJO_RESULT_OK) 168 if (result != MOJO_RESULT_OK)
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 } else { 460 } else {
461 entry->triggered_next->triggered_previous = entry->triggered_previous; 461 entry->triggered_next->triggered_previous = entry->triggered_previous;
462 } 462 }
463 463
464 entry->triggered_previous = nullptr; 464 entry->triggered_previous = nullptr;
465 entry->triggered_next = nullptr; 465 entry->triggered_next = nullptr;
466 } 466 }
467 467
468 } // namespace system 468 } // namespace system
469 } // namespace mojo 469 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/wait_set_dispatcher.h ('k') | mojo/edk/system/wait_set_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698