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

Unified Diff: mojo/edk/system/core.cc

Issue 779503003: Extract Awakable from Waiter (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Review Update Created 6 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
Index: mojo/edk/system/core.cc
diff --git a/mojo/edk/system/core.cc b/mojo/edk/system/core.cc
index 27d33b26db94a85b32993de05d751b055764b65b..74964aebcfc260210d948ff429b1d9169af7184a 100644
--- a/mojo/edk/system/core.cc
+++ b/mojo/edk/system/core.cc
@@ -47,10 +47,11 @@ namespace system {
// |Dispatcher|s for the handles that it wants to wait on with a |Waiter|
// object; this |Waiter| object may be created on the stack of that thread or be
// kept in thread local storage for that thread (TODO(vtl): future improvement).
-// The |Dispatcher| then adds the |Waiter| to a |WaiterList| that's either owned
-// by that |Dispatcher| (see |SimpleDispatcher|) or by a secondary object (e.g.,
-// |MessagePipe|). To signal/wake a |Waiter|, the object in question -- either a
-// |SimpleDispatcher| or a secondary object -- talks to its |WaiterList|.
+// The |Dispatcher| then adds the |Waiter| to a |AwakableList| that's either
viettrungluu 2014/12/03 22:31:27 "a" -> "an"
Hajime Morrita 2014/12/03 22:47:11 Done.
+// owned by that |Dispatcher| (see |SimpleDispatcher|) or by a secondary object
+// (e.g., |MessagePipe|). To signal/wake a |Waiter|, the object in question --
+// either a |SimpleDispatcher| or a secondary object -- talks to its
+// |AwakableList|.
// Thread-safety notes
//
@@ -561,7 +562,7 @@ MojoResult Core::WaitManyInternal(const MojoHandle* handles,
uint32_t i;
MojoResult rv = MOJO_RESULT_OK;
for (i = 0; i < num_handles; i++) {
- rv = dispatchers[i]->AddWaiter(
+ rv = dispatchers[i]->AddAwakable(
&waiter, signals[i], i, signals_states ? &signals_states[i] : nullptr);
if (rv != MOJO_RESULT_OK) {
*result_index = i;
@@ -579,8 +580,8 @@ MojoResult Core::WaitManyInternal(const MojoHandle* handles,
// |Wait()|/|WaitMany()| call. (Only after doing this can |waiter| be
// destroyed, but this would still be required if the waiter were in TLS.)
for (i = 0; i < num_added; i++) {
- dispatchers[i]->RemoveWaiter(&waiter,
- signals_states ? &signals_states[i] : nullptr);
+ dispatchers[i]->RemoveAwakable(
+ &waiter, signals_states ? &signals_states[i] : nullptr);
}
if (signals_states) {
for (; i < num_handles; i++)

Powered by Google App Engine
This is Rietveld 408576698