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

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

Issue 1504733002: Implementation of WaitSet for new EDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-waitset-implementation
Patch Set: Add gyp rules. Created 5 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
« no previous file with comments | « mojo/edk/system/core.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 d1c7b1f62548085958d459cff16606c8dd9e9247..c9a5eda52dcf47309a50109790615b54698e1f10 100644
--- a/mojo/edk/system/dispatcher.h
+++ b/mojo/edk/system/dispatcher.h
@@ -60,6 +60,7 @@ class MOJO_SYSTEM_IMPL_EXPORT Dispatcher
DATA_PIPE_PRODUCER,
DATA_PIPE_CONSUMER,
SHARED_BUFFER,
+ WAIT_SET,
// "Private" types (not exposed via the public interface):
PLATFORM_HANDLE = -1
@@ -147,6 +148,25 @@ class MOJO_SYSTEM_IMPL_EXPORT Dispatcher
// |*signals_state| will be set to the current handle signals state.
void RemoveAwakable(Awakable* awakable, HandleSignalsState* signals_state);
+ // Adds a dispatcher to wait on. When the dispatcher satisfies |signals|, it
+ // will be returned in the next call to |GetReadyDispatchers()|. If
+ // |dispatcher| has been added, it must be removed before adding again,
+ // otherwise |MOJO_RESULT_ALREADY_EXISTS| will be returned.
+ MojoResult AddWaitingDispatcher(const scoped_refptr<Dispatcher>& dispatcher,
+ MojoHandleSignals signals,
+ uintptr_t context);
+ // Removes a dispatcher to wait on. If |dispatcher| has not been added,
+ // |MOJO_RESULT_NOT_FOUND| will be returned.
+ MojoResult RemoveWaitingDispatcher(
+ const scoped_refptr<Dispatcher>& dispatcher);
+ // Returns a set of ready dispatchers. |*count| is the maximum number of
+ // dispatchers to return, and will contain the number of dispatchers returned
+ // in |dispatchers| on completion.
+ MojoResult GetReadyDispatchers(uint32_t* count,
+ DispatcherVector* dispatchers,
+ MojoResult* results,
+ uintptr_t* contexts);
+
// A dispatcher must be put into a special state in order to be sent across a
// message pipe. Outside of tests, only |HandleTableAccess| is allowed to do
// this, since there are requirements on the handle table (see below).
@@ -265,6 +285,17 @@ class MOJO_SYSTEM_IMPL_EXPORT Dispatcher
HandleSignalsState* signals_state);
virtual void RemoveAwakableImplNoLock(Awakable* awakable,
HandleSignalsState* signals_state);
+ virtual MojoResult AddWaitingDispatcherImplNoLock(
+ const scoped_refptr<Dispatcher>& dispatcher,
+ MojoHandleSignals signals,
+ uintptr_t context);
+ virtual MojoResult RemoveWaitingDispatcherImplNoLock(
+ const scoped_refptr<Dispatcher>& dispatcher);
+ virtual MojoResult GetReadyDispatchersImplNoLock(
+ uint32_t* count,
+ DispatcherVector* dispatchers,
+ MojoResult* results,
+ uintptr_t* contexts);
// These implement the API used to serialize dispatchers (described below).
// They will only be called on a dispatcher that's attached to and "owned" by
« no previous file with comments | « mojo/edk/system/core.cc ('k') | mojo/edk/system/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698