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

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

Issue 2088833003: Add different behavior to AwakableList for "persistent" vs "one-shot" awakables. (Closed) Base URL: https://github.com/domokit/mojo.git@work793_wait_set_4.5
Patch Set: 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/simple_dispatcher.h ('k') | mojo/edk/system/wait_set_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/simple_dispatcher.cc
diff --git a/mojo/edk/system/simple_dispatcher.cc b/mojo/edk/system/simple_dispatcher.cc
index 25ae5ff04e0861e2b621f8edcef903b862cbb063..1d844bbb8ce97b7d52ec2897803c319322c4f350 100644
--- a/mojo/edk/system/simple_dispatcher.cc
+++ b/mojo/edk/system/simple_dispatcher.cc
@@ -22,13 +22,13 @@ void SimpleDispatcher::OnHandleSignalsStateChangeNoLock(
void SimpleDispatcher::CancelAllStateNoLock() {
mutex().AssertHeld();
- awakable_list_.CancelAll();
+ awakable_list_.CancelAndRemoveAll();
}
MojoResult SimpleDispatcher::AddAwakableImplNoLock(
Awakable* awakable,
uint64_t context,
- bool force,
+ bool persistent,
MojoHandleSignals signals,
HandleSignalsState* signals_state) {
mutex().AssertHeld();
@@ -37,17 +37,17 @@ MojoResult SimpleDispatcher::AddAwakableImplNoLock(
if (signals_state)
*signals_state = state;
if (state.satisfies(signals)) {
- if (force)
- awakable_list_.Add(awakable, context, signals);
+ if (persistent)
+ awakable_list_.Add(awakable, context, persistent, signals);
return MOJO_RESULT_ALREADY_EXISTS;
}
if (!state.can_satisfy(signals)) {
- if (force)
- awakable_list_.Add(awakable, context, signals);
+ if (persistent)
+ awakable_list_.Add(awakable, context, persistent, signals);
return MOJO_RESULT_FAILED_PRECONDITION;
}
- awakable_list_.Add(awakable, context, signals);
+ awakable_list_.Add(awakable, context, persistent, signals);
return MOJO_RESULT_OK;
}
« no previous file with comments | « mojo/edk/system/simple_dispatcher.h ('k') | mojo/edk/system/wait_set_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698