summary refs log tree commit diff
path: root/async_core
diff options
context:
space:
mode:
authorDylan Reid <dgreid@chromium.org>2020-04-24 03:51:19 +0000
committerCommit Bot <commit-bot@chromium.org>2020-04-29 03:04:36 +0000
commit887289e5d455d2cd026a2b178002ed009ea8bdd4 (patch)
tree029605b6be138ae09bc2d00b2167c4a5c1f596c0 /async_core
parent7b8f776cb807ce1174899e567b2b00a040fe409f (diff)
downloadcrosvm-887289e5d455d2cd026a2b178002ed009ea8bdd4.tar
crosvm-887289e5d455d2cd026a2b178002ed009ea8bdd4.tar.gz
crosvm-887289e5d455d2cd026a2b178002ed009ea8bdd4.tar.bz2
crosvm-887289e5d455d2cd026a2b178002ed009ea8bdd4.tar.lz
crosvm-887289e5d455d2cd026a2b178002ed009ea8bdd4.tar.xz
crosvm-887289e5d455d2cd026a2b178002ed009ea8bdd4.tar.zst
crosvm-887289e5d455d2cd026a2b178002ed009ea8bdd4.zip
cros_async: allow wakers to be canceled
Allowing for wakers to be canceled will allow futures that register
wakers properly implement `Drop`. As it is, they won't ever fire but the
saved FD will leak.

TEST=added 'cancel' unit test to fd_executor:
"cargo test cancel" from the cros_async directory.
Change-Id: Iab5bea6aac0cc689392997745f5dcc8c285200d9

Change-Id: I1df1a04897e8d2c5e9c414d84998084607209fb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2164074
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
Diffstat (limited to 'async_core')
-rw-r--r--async_core/src/eventfd.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/async_core/src/eventfd.rs b/async_core/src/eventfd.rs
index b930f07..fdff83e 100644
--- a/async_core/src/eventfd.rs
+++ b/async_core/src/eventfd.rs
@@ -109,7 +109,7 @@ impl Stream for EventFd {
             .or_else(|e| {
                 if e.errno() == EWOULDBLOCK {
                     add_read_waker(self.inner.as_raw_fd(), cx.waker().clone())
-                        .map(|()| Poll::Pending)
+                        .map(|_token| Poll::Pending)
                         .map_err(Error::AddingWaker)
                 } else {
                     Err(Error::EventFdRead(e))