summary refs log tree commit diff
path: root/async_core
Commit message (Collapse)AuthorAge
* async_core: Add async TimerFdDylan Reid2020-05-07
| | | | | | | | | | | | An async timer FD will allow block to keep the flush timer when it is converted to async. Change-Id: I25759be0f969d1962fd13f33709166527d8f117d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2168644 Tested-by: Dylan Reid <dgreid@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Dylan Reid <dgreid@chromium.org> Commit-Queue: Dylan Reid <dgreid@chromium.org>
* cros_async: Hide the details of fd_executorDylan Reid2020-05-07
| | | | | | | | | | | | | | The type of the executor leaked from the cros_async crate. That was fine until the desire to add a new executor arose. Hide the fd_executor so that a uring_executor can be substituted on newer kernels. Change-Id: I8dd309fd47e1b4a6e16da274abbb8431c80474af Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2182042 Reviewed-by: Stephen Barber <smbarber@chromium.org> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Dylan Reid <dgreid@chromium.org> Commit-Queue: Dylan Reid <dgreid@chromium.org>
* async_core: eventfd: implement a future for the next valueDylan Reid2020-05-05
| | | | | | | | | | | | | | | | | | | | | | | 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>
* cros_async: allow wakers to be canceledDylan Reid2020-04-29
| | | | | | | | | | | | | | | | 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>
* async_core: fix formatting of use statementDylan Reid2020-02-11
| | | | | | | | | Change-Id: I609da3eb581349315d1fb84a6a5fba233ec26b5f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2048218 Reviewed-by: Dylan Reid <dgreid@chromium.org> Commit-Queue: Dylan Reid <dgreid@chromium.org> Tested-by: Dylan Reid <dgreid@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com>
* Add async_core crateDylan Reid2020-02-10
This crate will provide asynchronous helpers wrapping primitives provided by sys_util. To start EventFDs and MsgReceivers are provided. Change-Id: Ia8862adafca995a3e3ab56582acc166a37fc8d2c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1955046 Reviewed-by: Dylan Reid <dgreid@chromium.org> Tested-by: Dylan Reid <dgreid@chromium.org> Commit-Queue: Dylan Reid <dgreid@chromium.org>