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

Unified Diff: mojo/public/c/system/wait_set.h

Issue 1461213002: WaitSet implementation for old EDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-waitset-skeleton
Patch Set: Fix windows build and style issues. Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/public/platform/native/system_thunks.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/system/wait_set.h
diff --git a/mojo/public/c/system/wait_set.h b/mojo/public/c/system/wait_set.h
index c237403b976d91bd35045d1aa53dd35212d7982a..3f3365afdb64b8d1f2c692247f1a296048002c44 100644
--- a/mojo/public/c/system/wait_set.h
+++ b/mojo/public/c/system/wait_set.h
@@ -38,6 +38,10 @@ MOJO_SYSTEM_EXPORT MojoResult MojoCreateWaitSet(
// any number of different wait sets. To modify the signals being waited for,
// the handle must first be removed, and then added with the new signals.
//
+// If a handle is closed while still in the wait set, it is implicitly removed
+// from the set after being returned from |MojoGetReadyHandles()| with the
+// result |MOJO_RESULT_CANCELLED|.
+//
// It is safe to add a handle to a wait set while performing a wait on another
// thread. If the added handle already has its signals satisfied, the waiting
// thread will be woken.
@@ -80,7 +84,7 @@ MOJO_SYSTEM_EXPORT MojoResult MojoRemoveHandle(
// |MOJO_HANDLE_SIGNAL_READABLE| signal. Since handles may be added and removed
// from a wait set concurrently, it is possible for a wait set to satisfy
// |MOJO_HANDLE_SIGNAL_READABLE|, but not have any ready handles when
-// |MojoGetReadyHandle()| is called. These spurious wake-ups must be gracefully
+// |MojoGetReadyHandles()| is called. These spurious wake-ups must be gracefully
// handled.
//
// |*count| on input, must contain the maximum number of ready handles to be
@@ -99,11 +103,12 @@ MOJO_SYSTEM_EXPORT MojoResult MojoRemoveHandle(
// |signals_state| (optional) if non-null, must point to an array of size
// |*count| of |MojoHandleSignalsState|. It will be populated with the signals
// state of the corresponding handle in |*handles|. See documentation for
-// |MojoHandleSignalsState|.
+// |MojoHandleSignalsState| for more details about the meaning of each array
+// entry. The array will always be updated for every returned handle.
//
// Mojo signals and satisfiability are logically 'level-triggered'. Therefore,
// if a signal continues to be satisfied and is not removed from the wait set,
-// subsequent calls to |MojoGetReadyHandle()| will return the same handle.
+// subsequent calls to |MojoGetReadyHandles()| will return the same handle.
//
// If multiple handles have their signals satisfied, the order in which handles
// are returned is undefined. The same handle, if not removed, may be returned
« no previous file with comments | « no previous file | mojo/public/platform/native/system_thunks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698