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

Side by Side Diff: mojo/public/c/system/watcher.h

Issue 2754083003: Mojo EDK: Circulate MojoArmWatcher outputs to avoid starvation (Closed)
Patch Set: . Created 3 years, 9 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #ifndef MOJO_PUBLIC_C_SYSTEM_WATCHER_H_ 5 #ifndef MOJO_PUBLIC_C_SYSTEM_WATCHER_H_
6 #define MOJO_PUBLIC_C_SYSTEM_WATCHER_H_ 6 #define MOJO_PUBLIC_C_SYSTEM_WATCHER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "mojo/public/c/system/system_export.h" 10 #include "mojo/public/c/system/system_export.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 // notified immediately upon arming the watcher. If |num_handles| is 160 // notified immediately upon arming the watcher. If |num_handles| is
161 // non-null, this assumes there is enough space for |*num_handles| entries 161 // non-null, this assumes there is enough space for |*num_handles| entries
162 // in each of the subsequent output buffer arguments. 162 // in each of the subsequent output buffer arguments.
163 // 163 //
164 // At most that many entries are placed in the output buffers, 164 // At most that many entries are placed in the output buffers,
165 // corresponding to the watches which would have signalled if the watcher 165 // corresponding to the watches which would have signalled if the watcher
166 // had been armed successfully. The actual number of entries placed in the 166 // had been armed successfully. The actual number of entries placed in the
167 // output buffers is written to |*num_ready_contexts| before returning. 167 // output buffers is written to |*num_ready_contexts| before returning.
168 // 168 //
169 // If more than (input) |*num_ready_contexts| watch contexts were ready to 169 // If more than (input) |*num_ready_contexts| watch contexts were ready to
170 // notify, the subset presented in output buffers is arbitrary and 170 // notify, the subset presented in output buffers is arbitrary, but the
171 // implementation-defined. 171 // implementation makes a best effort to circulate the outputs across
172 // consecutive calls so that callers may reliably avoid handle starvation.
172 MOJO_SYSTEM_EXPORT MojoResult 173 MOJO_SYSTEM_EXPORT MojoResult
173 MojoArmWatcher(MojoHandle watcher_handle, 174 MojoArmWatcher(MojoHandle watcher_handle,
174 uint32_t* num_ready_contexts, 175 uint32_t* num_ready_contexts,
175 uintptr_t* ready_contexts, 176 uintptr_t* ready_contexts,
176 MojoResult* ready_results, 177 MojoResult* ready_results,
177 struct MojoHandleSignalsState* ready_signals_states); 178 struct MojoHandleSignalsState* ready_signals_states);
178 179
179 #ifdef __cplusplus 180 #ifdef __cplusplus
180 } // extern "C" 181 } // extern "C"
181 #endif 182 #endif
182 183
183 #endif // MOJO_PUBLIC_C_SYSTEM_WATCHER_H_ 184 #endif // MOJO_PUBLIC_C_SYSTEM_WATCHER_H_
OLDNEW
« mojo/edk/system/watcher_dispatcher.cc ('K') | « mojo/edk/system/watcher_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698