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

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

Issue 2068483002: Add an unconditional version of DispatcherAddAwakable(): AddAwakableUnconditional(). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: oops 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/data_pipe_producer_dispatcher.cc ('k') | mojo/edk/system/dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/dispatcher.h
diff --git a/mojo/edk/system/dispatcher.h b/mojo/edk/system/dispatcher.h
index d9fb416d8faf80b5121873c5c5d5df538bc9151f..8b438b88008196d86edac48ef7ad52bdc45d0d35 100644
--- a/mojo/edk/system/dispatcher.h
+++ b/mojo/edk/system/dispatcher.h
@@ -198,7 +198,8 @@ class Dispatcher : public util::RefCountedThreadSafe<Dispatcher> {
//
// Returns:
// - |MOJO_RESULT_OK| if the awakable was added;
- // - |MOJO_RESULT_ALREADY_EXISTS| if |signals| is already satisfied;
+ // - |MOJO_RESULT_ALREADY_EXISTS| if |signals| is already satisfied (if
+ // |force| is true, the awakable will still be added);
// - |MOJO_RESULT_INVALID_ARGUMENT| if the dispatcher has been closed; and
// - |MOJO_RESULT_FAILED_PRECONDITION| if it is not (or no longer) possible
// that |signals| will ever be satisfied.
@@ -206,6 +207,13 @@ class Dispatcher : public util::RefCountedThreadSafe<Dispatcher> {
MojoHandleSignals signals,
uint64_t context,
HandleSignalsState* signals_state);
+ // Like |AddAwakable()|, but in the |MOJO_RESULT_ALREADY_EXISTS| case still
+ // adds the awakable (|MOJO_RESULT_ALREADY_EXISTS| will still be returned and
+ // |*signals_state| will still be set if |signals_state| is non-null).
+ MojoResult AddAwakableUnconditional(Awakable* awakable,
+ MojoHandleSignals signals,
+ uint64_t context,
+ HandleSignalsState* signals_state);
// Removes an awakable from this dispatcher. (It is valid to call this
// multiple times for the same |awakable| on the same object, so long as
// |AddAwakable()| was called at most once.) If |signals_state| is non-null,
@@ -383,6 +391,7 @@ class Dispatcher : public util::RefCountedThreadSafe<Dispatcher> {
MOJO_SHARED_LOCKS_REQUIRED(mutex_);
virtual MojoResult AddAwakableImplNoLock(Awakable* awakable,
MojoHandleSignals signals,
+ bool force,
uint64_t context,
HandleSignalsState* signals_state)
MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
« no previous file with comments | « mojo/edk/system/data_pipe_producer_dispatcher.cc ('k') | mojo/edk/system/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698