diff options
author | Dylan Reid <dgreid@chromium.org> | 2020-04-29 22:28:23 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-05-05 03:35:10 +0000 |
commit | f60fb14a729002668688d2638750df041c9f1525 (patch) | |
tree | 4e3ce1d1b87d322f089480e9427765134b5876ea | |
parent | aee62a8adddd15cc2638bcb815ed0a86cc748bdb (diff) | |
download | crosvm-f60fb14a729002668688d2638750df041c9f1525.tar crosvm-f60fb14a729002668688d2638750df041c9f1525.tar.gz crosvm-f60fb14a729002668688d2638750df041c9f1525.tar.bz2 crosvm-f60fb14a729002668688d2638750df041c9f1525.tar.lz crosvm-f60fb14a729002668688d2638750df041c9f1525.tar.xz crosvm-f60fb14a729002668688d2638750df041c9f1525.tar.zst crosvm-f60fb14a729002668688d2638750df041c9f1525.zip |
cros_async: Don't wake wakers on removal
There is no need to repoll the waker after it is canceled. This was a copy paste error that was harmless until tested with futures-rs combinators that re-use wakers aggressively. Change-Id: Ie84778b96ff6aa2b58bfe61cd96a78786797ad78 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2173971 Tested-by: Dylan Reid <dgreid@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Dylan Reid <dgreid@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
-rw-r--r-- | cros_async/src/fd_executor.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/cros_async/src/fd_executor.rs b/cros_async/src/fd_executor.rs index 349cc42..cc67793 100644 --- a/cros_async/src/fd_executor.rs +++ b/cros_async/src/fd_executor.rs @@ -186,9 +186,8 @@ impl FdWakerState { // Remove the waker for the given token if it hasn't fired yet. fn cancel_waker(&mut self, token: WakerToken) -> Result<()> { - if let Some((fd, waker)) = self.token_map.remove(&token.0) { + if let Some((fd, _waker)) = self.token_map.remove(&token.0) { self.poll_ctx.delete(&fd).map_err(Error::PollContextError)?; - waker.wake_by_ref(); } Ok(()) } |