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

Unified Diff: mojo/edk/system/awakable_list.h

Issue 2090763002: AwakableList: For persistent awakables, make Add() call Awake() with reason INITIALIZE. (Closed) Base URL: https://github.com/domokit/mojo.git@work795_wait_set_4.7-x-work794_wait_set_4.6
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/edk/system/awakable.cc ('k') | mojo/edk/system/awakable_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/awakable_list.h
diff --git a/mojo/edk/system/awakable_list.h b/mojo/edk/system/awakable_list.h
index 83b60930f429442464b6b7a73a596c9ef54bb978..164fb1d338db03b32039200938a691f2f382e9b7 100644
--- a/mojo/edk/system/awakable_list.h
+++ b/mojo/edk/system/awakable_list.h
@@ -45,14 +45,18 @@ class AwakableList {
// |Awakable::AwakeReason::SATISFIED|), all watched signals become
// never-satisfiable (|Awakable::AwakeReason::UNSATISFIABLE|), or
// |CancelAndRemoveAll()| is called (|Awakable::AwakeReason::CANCELLED|).
- // - A persistent awakable's |Awake()| will be called for all state changes
- // on watched signals (with reason |Awakable::AwakeReason::CHANGED|) until
- // |CancelAndRemoveAll()| is called (at which point its |Awake()| will be
- // called a final time with reason |Awakable::AwakeReason::CANCELLED|).
+ // - A persistent awakable's |Awake()| will be called inside |Add()| (under
+ // any mutex protecting the |AwakableList()| -- this is similar to
+ // |OnStateChange()|) (with reason |Awakable::AwakeReason::INITIALIZE|),
+ // and then subsequently for all state changes on watched signals
+ // (|Awakable::AwakeReason::CHANGED|) until |CancelAndRemoveAll()| is
+ // called (at which point its |Awake()| will be called a final time with
+ // reason |Awakable::AwakeReason::CANCELLED|).
void Add(Awakable* awakable,
uint64_t context,
bool persistent,
- MojoHandleSignals signals);
+ MojoHandleSignals signals,
+ const HandleSignalsState& current_state);
// Removes all awakables matching the given pointer and, if |match_context| is
// true, the given context.
« no previous file with comments | « mojo/edk/system/awakable.cc ('k') | mojo/edk/system/awakable_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698