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

Unified Diff: mojo/edk/system/awakable.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 | « no previous file | mojo/edk/system/awakable.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/awakable.h
diff --git a/mojo/edk/system/awakable.h b/mojo/edk/system/awakable.h
index b4524f245295e439fc0bc26bcf6a40e44fe5762d..ab338d0be73a7d19ac5e8adcb065f24a0b3b399f 100644
--- a/mojo/edk/system/awakable.h
+++ b/mojo/edk/system/awakable.h
@@ -17,13 +17,26 @@ namespace system {
// implementation that blocks while waiting to be awoken.
class Awakable {
public:
- // See |AwakableList| (in particular its |Add()| method).
- enum class AwakeReason { SATISFIED, UNSATISFIABLE, CANCELLED, CHANGED };
+ // See |AwakableList| (in particular its |Add()| method) for information about
+ // persistent versus one-shot awakables.
+ enum class AwakeReason {
+ // Sent to both persistent and one-shot awakables (after |Awake()| is
+ // called with this, it will no longer be called by the same source):
+ CANCELLED,
+ // Sent to one-shot awakables:
+ SATISFIED,
+ UNSATISFIABLE,
+ // Sent to persistent awakables:
+ INITIALIZE,
+ CHANGED,
+ };
// Helper function that translates:
+ // - |AwakeReason::CANCELLED| -> |MOJO_RESULT_CANCELLED|.
// - |AwakeReason::SATISFIED| -> |MOJO_RESULT_OK|,
// - |AwakeReason::UNSATISFIABLE| -> |MOJO_RESULT_FAILED_PRECONDITION|, and
- // - |AwakeReason::CANCELLED| -> |MOJO_RESULT_CANCELLED|.
+ // - |AwakeReason::INITIALIZE| -> |MOJO_RESULT_INTERNAL| (this function
+ // never be called with this reason).
// - |AwakeReason::CHANGED| -> |MOJO_RESULT_INTERNAL| (this function never
// be called with this reason).
static MojoResult MojoResultForAwakeReason(AwakeReason reason);
« no previous file with comments | « no previous file | mojo/edk/system/awakable.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698