| Index: mojo/edk/system/dispatcher.cc
|
| diff --git a/mojo/edk/system/dispatcher.cc b/mojo/edk/system/dispatcher.cc
|
| index 11f73e244afac2731df7d1f113d5ea9f9f048927..7d9741af920030dce0168643a7d23c77743ad996 100644
|
| --- a/mojo/edk/system/dispatcher.cc
|
| +++ b/mojo/edk/system/dispatcher.cc
|
| @@ -337,15 +337,28 @@ MojoResult Dispatcher::AddAwakableUnconditional(
|
| }
|
|
|
| void Dispatcher::RemoveAwakable(Awakable* awakable,
|
| - HandleSignalsState* handle_signals_state) {
|
| + HandleSignalsState* signals_state) {
|
| MutexLocker locker(&mutex_);
|
| if (is_closed_) {
|
| - if (handle_signals_state)
|
| - *handle_signals_state = HandleSignalsState();
|
| + if (signals_state)
|
| + *signals_state = HandleSignalsState();
|
| + return;
|
| + }
|
| +
|
| + RemoveAwakableImplNoLock(awakable, signals_state);
|
| +}
|
| +
|
| +void Dispatcher::RemoveAwakableWithContext(Awakable* awakable,
|
| + uint64_t context,
|
| + HandleSignalsState* signals_state) {
|
| + MutexLocker locker(&mutex_);
|
| + if (is_closed_) {
|
| + if (signals_state)
|
| + *signals_state = HandleSignalsState();
|
| return;
|
| }
|
|
|
| - RemoveAwakableImplNoLock(awakable, handle_signals_state);
|
| + RemoveAwakableWithContextImplNoLock(awakable, context, signals_state);
|
| }
|
|
|
| Dispatcher::Dispatcher() : is_closed_(false) {}
|
| @@ -579,6 +592,18 @@ void Dispatcher::RemoveAwakableImplNoLock(Awakable* /*awakable*/,
|
| *signals_state = HandleSignalsState();
|
| }
|
|
|
| +void Dispatcher::RemoveAwakableWithContextImplNoLock(
|
| + Awakable* /*awakable*/,
|
| + uint64_t /*context*/,
|
| + HandleSignalsState* signals_state) {
|
| + mutex_.AssertHeld();
|
| + DCHECK(!is_closed_);
|
| + // By default, waiting isn't supported. Only dispatchers that can be waited on
|
| + // will do something nontrivial.
|
| + if (signals_state)
|
| + *signals_state = HandleSignalsState();
|
| +}
|
| +
|
| void Dispatcher::StartSerializeImplNoLock(Channel* /*channel*/,
|
| size_t* max_size,
|
| size_t* max_platform_handles) {
|
|
|