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

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

Issue 2084593005: Rationalize AddAwakable...() and RemoveAwakable...() methods. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: doh 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_unittest.cc ('k') | mojo/edk/system/waiter_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/wait_set_dispatcher.cc
diff --git a/mojo/edk/system/wait_set_dispatcher.cc b/mojo/edk/system/wait_set_dispatcher.cc
index 7525a21ddbfe7f7148e072d0fa5aee44dc09ce5c..4b5c7da0fa79389d3d48bedabac8fdc573fb7bb1 100644
--- a/mojo/edk/system/wait_set_dispatcher.cc
+++ b/mojo/edk/system/wait_set_dispatcher.cc
@@ -124,8 +124,7 @@ void WaitSetDispatcher::CloseImplNoLock() {
for (auto& p : entries) {
const auto& entry = p.second;
if (entry->dispatcher)
- entry->dispatcher->RemoveAwakableWithContext(this, entry->cookie,
- nullptr);
+ entry->dispatcher->RemoveAwakable(true, this, entry->cookie, nullptr);
}
// The caller of |CloseImplNoLock()| expects |mutex()| to be locked, so we
@@ -170,8 +169,8 @@ MojoResult WaitSetDispatcher::WaitSetAddImpl(
}
HandleSignalsState signals_state;
- MojoResult result = dispatcher->AddAwakableUnconditional(
- this, signals, cookie, &signals_state);
+ MojoResult result =
+ dispatcher->AddAwakable(this, cookie, true, signals, &signals_state);
// Can't use |MutexLocker|, since we need to do some work outside the lock
// in some code paths.
@@ -188,7 +187,7 @@ MojoResult WaitSetDispatcher::WaitSetAddImpl(
mutex().Unlock();
if (result == MOJO_RESULT_OK || result == MOJO_RESULT_ALREADY_EXISTS) {
// We have to remove ourself from the target dispatcher's awakable list.
- dispatcher->RemoveAwakableWithContext(this, cookie, nullptr);
+ dispatcher->RemoveAwakable(true, this, cookie, nullptr);
}
return MOJO_RESULT_INVALID_ARGUMENT;
}
@@ -243,7 +242,7 @@ MojoResult WaitSetDispatcher::WaitSetRemoveImpl(uint64_t cookie) {
}
if (dispatcher)
- dispatcher->RemoveAwakableWithContext(this, cookie, nullptr);
+ dispatcher->RemoveAwakable(true, this, cookie, nullptr);
return MOJO_RESULT_OK;
}
@@ -271,8 +270,8 @@ bool WaitSetDispatcher::Awake(uint64_t context,
// |CloseImplNoLock()| (after that, we will have been removed from all the
// awakable lists, so |Awake()| should no longer be called). We may as well
// return false here, which will automatically remove ourselves from the
- // awakable list (|CloseImplNoLock()| will call
- // |RemoveAwakableWithContext()| anyway, but that's OK).
+ // awakable list (|CloseImplNoLock()| will call |RemoveAwakable()| anyway,
+ // but that's OK).
return false;
}
« no previous file with comments | « mojo/edk/system/simple_dispatcher_unittest.cc ('k') | mojo/edk/system/waiter_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698