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

Unified Diff: mojo/edk/system/data_pipe.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/data_pipe.h ('k') | mojo/edk/system/data_pipe_consumer_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/data_pipe.cc
diff --git a/mojo/edk/system/data_pipe.cc b/mojo/edk/system/data_pipe.cc
index d74cba8759839b4dfcbd01f8776a21edd284f7d4..b64eec402baedeb9717d0e6cab38e39e020b25a9 100644
--- a/mojo/edk/system/data_pipe.cc
+++ b/mojo/edk/system/data_pipe.cc
@@ -399,6 +399,7 @@ HandleSignalsState DataPipe::ProducerGetHandleSignalsState() {
MojoResult DataPipe::ProducerAddAwakable(Awakable* awakable,
MojoHandleSignals signals,
+ bool force,
uint64_t context,
HandleSignalsState* signals_state) {
MutexLocker locker(&mutex_);
@@ -406,6 +407,8 @@ MojoResult DataPipe::ProducerAddAwakable(Awakable* awakable,
HandleSignalsState producer_state = impl_->ProducerGetHandleSignalsState();
if (producer_state.satisfies(signals)) {
+ if (force)
+ producer_awakable_list_->Add(awakable, signals, context);
if (signals_state)
*signals_state = producer_state;
return MOJO_RESULT_ALREADY_EXISTS;
@@ -618,6 +621,7 @@ HandleSignalsState DataPipe::ConsumerGetHandleSignalsState() {
MojoResult DataPipe::ConsumerAddAwakable(Awakable* awakable,
MojoHandleSignals signals,
+ bool force,
uint64_t context,
HandleSignalsState* signals_state) {
MutexLocker locker(&mutex_);
@@ -625,6 +629,8 @@ MojoResult DataPipe::ConsumerAddAwakable(Awakable* awakable,
HandleSignalsState consumer_state = impl_->ConsumerGetHandleSignalsState();
if (consumer_state.satisfies(signals)) {
+ if (force)
+ consumer_awakable_list_->Add(awakable, signals, context);
if (signals_state)
*signals_state = consumer_state;
return MOJO_RESULT_ALREADY_EXISTS;
« no previous file with comments | « mojo/edk/system/data_pipe.h ('k') | mojo/edk/system/data_pipe_consumer_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698