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

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

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/dispatcher.h ('k') | mojo/edk/system/local_message_pipe_endpoint.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/dispatcher.cc
diff --git a/mojo/edk/system/dispatcher.cc b/mojo/edk/system/dispatcher.cc
index 29162bfc051637ff4cdf6c23a7ead97b7047673e..19621c82acbf6a534e2ce5bd1c960258989ef9a1 100644
--- a/mojo/edk/system/dispatcher.cc
+++ b/mojo/edk/system/dispatcher.cc
@@ -325,7 +325,23 @@ MojoResult Dispatcher::AddAwakable(Awakable* awakable,
return MOJO_RESULT_INVALID_ARGUMENT;
}
- return AddAwakableImplNoLock(awakable, signals, context, signals_state);
+ return AddAwakableImplNoLock(awakable, signals, false, context,
+ signals_state);
+}
+
+MojoResult Dispatcher::AddAwakableUnconditional(
+ Awakable* awakable,
+ MojoHandleSignals signals,
+ uint64_t context,
+ HandleSignalsState* signals_state) {
+ MutexLocker locker(&mutex_);
+ if (is_closed_) {
+ if (signals_state)
+ *signals_state = HandleSignalsState();
+ return MOJO_RESULT_INVALID_ARGUMENT;
+ }
+
+ return AddAwakableImplNoLock(awakable, signals, true, context, signals_state);
}
void Dispatcher::RemoveAwakable(Awakable* awakable,
@@ -551,6 +567,7 @@ HandleSignalsState Dispatcher::GetHandleSignalsStateImplNoLock() const {
MojoResult Dispatcher::AddAwakableImplNoLock(
Awakable* /*awakable*/,
MojoHandleSignals /*signals*/,
+ bool /*force*/,
uint64_t /*context*/,
HandleSignalsState* signals_state) {
mutex_.AssertHeld();
« no previous file with comments | « mojo/edk/system/dispatcher.h ('k') | mojo/edk/system/local_message_pipe_endpoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698