summary refs log tree commit diff
path: root/fuzz
diff options
context:
space:
mode:
authorDylan Reid <dgreid@chromium.org>2020-04-24 05:54:23 +0000
committerCommit Bot <commit-bot@chromium.org>2020-05-05 03:35:11 +0000
commit34c00465d5eba814b9eeebf8971f4667e7f1f75d (patch)
tree4d396a3b9369e4a6122465b36b37d643806b0036 /fuzz
parent4381d04dd99956a9d95fe8735b665cb9e8750fae (diff)
downloadcrosvm-34c00465d5eba814b9eeebf8971f4667e7f1f75d.tar
crosvm-34c00465d5eba814b9eeebf8971f4667e7f1f75d.tar.gz
crosvm-34c00465d5eba814b9eeebf8971f4667e7f1f75d.tar.bz2
crosvm-34c00465d5eba814b9eeebf8971f4667e7f1f75d.tar.lz
crosvm-34c00465d5eba814b9eeebf8971f4667e7f1f75d.tar.xz
crosvm-34c00465d5eba814b9eeebf8971f4667e7f1f75d.tar.zst
crosvm-34c00465d5eba814b9eeebf8971f4667e7f1f75d.zip
async_core: eventfd: implement a future for the next value
It is useful to have the ability to get a future for only the next
value. This is helpful when borrowing the EventFd for the duration of a
loop is not feasible. It is also helpful for situations where the future
might be dropped. Because dropping a polled eventfd future can leak an
FD, and there is no way to implement a custom `Drop` for the future
returned by stream, using the new `read_next` is the only way to ensure
there aren't any FD leaks if the future might be dropped before
completion.

TEST=added a unit test that makes use of the new feature and mirrors the
existing stream test.
cargo test eventfd_write_read

Change-Id: I9b20c89be561e4a1ca43f2befc66c16188a91d4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2173973
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>
Diffstat (limited to 'fuzz')
0 files changed, 0 insertions, 0 deletions