| Index: mojo/edk/system/awakable.h
|
| diff --git a/mojo/edk/system/awakable.h b/mojo/edk/system/awakable.h
|
| index cbd024078210a1752875992c110f4276129c4209..b4524f245295e439fc0bc26bcf6a40e44fe5762d 100644
|
| --- a/mojo/edk/system/awakable.h
|
| +++ b/mojo/edk/system/awakable.h
|
| @@ -17,21 +17,24 @@ namespace system {
|
| // implementation that blocks while waiting to be awoken.
|
| class Awakable {
|
| public:
|
| - enum class AwakeReason { SATISFIED, UNSATISFIABLE, CANCELLED };
|
| + // See |AwakableList| (in particular its |Add()| method).
|
| + enum class AwakeReason { SATISFIED, UNSATISFIABLE, CANCELLED, CHANGED };
|
|
|
| // Helper function that translates:
|
| // - |AwakeReason::SATISFIED| -> |MOJO_RESULT_OK|,
|
| // - |AwakeReason::UNSATISFIABLE| -> |MOJO_RESULT_FAILED_PRECONDITION|, and
|
| // - |AwakeReason::CANCELLED| -> |MOJO_RESULT_CANCELLED|.
|
| + // - |AwakeReason::CHANGED| -> |MOJO_RESULT_INTERNAL| (this function never
|
| + // be called with this reason).
|
| static MojoResult MojoResultForAwakeReason(AwakeReason reason);
|
|
|
| // |Awake()| must satisfy the following contract:
|
| // - It must be thread-safe.
|
| // - Since it is called with a mutex held, it must not call anything that
|
| // takes "non-terminal" locks, i.e., those which are always safe to take.
|
| - // - It should return false if it must not be called again for the same
|
| - // reason (e.g., for the same call to |AwakableList::Add()|).
|
| - virtual bool Awake(uint64_t context,
|
| + // If |reason| is |AwakeReason::CANCELLED|, |Awake()| will not be called
|
| + // again (by the same source).
|
| + virtual void Awake(uint64_t context,
|
| AwakeReason reason,
|
| const HandleSignalsState& signals_state) = 0;
|
|
|
|
|