From f60fb14a729002668688d2638750df041c9f1525 Mon Sep 17 00:00:00 2001 From: Dylan Reid Date: Wed, 29 Apr 2020 22:28:23 +0000 Subject: 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 Tested-by: kokoro Commit-Queue: Dylan Reid Reviewed-by: Stephen Barber Reviewed-by: Chirantan Ekbote --- cros_async/src/fd_executor.rs | 3 +-- 1 file changed, 1 insertion(+), 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(()) } -- cgit 1.4.1