summary refs log tree commit diff
path: root/cros_async
Commit message (Collapse)AuthorAge
* 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>
* cros_async: implement waker_wakeDylan Reid2020-05-05
| | | | | | | | | | | | | | | | Some futures-rs combinators call wake directly instead of using wake_by_ref. This was left out as on oversight because the initial executor code only used wake_by_ref. TEST=run tests with the combinators from futures-rs Change-Id: I8ac06dfd47d34eee493a5b1194d00ef9d7f6bc18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2173972 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: Don't wake wakers on removalDylan Reid2020-05-05
| | | | | | | | | | | | | | 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>
* cros_async: Add a function to run one future to completionDylan Reid2020-05-05
| | | | | | | | | | | | | | | | | Adding the ability to run one future to completion will allow for driving the top level future through the executer when only one future is needed. For example, if a future-rs combinator is used to collect several sub futures. TEST=update doc test cargo test Change-Id: Idd1121310a3043bb4110853e5e72eef3bd06950e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2173970 Reviewed-by: Dylan Reid <dgreid@chromium.org> Tested-by: Dylan Reid <dgreid@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Dylan Reid <dgreid@chromium.org>
* cros_async: Add select6Dylan Reid2020-05-01
| | | | | | | | | | | | | | Balloon needs six futures to be selected between, allow that with a new macro. TEST=added doc test Change-Id: I6c15ae5e2f6a8dcbbf0e0700e6b64fb5ca459f97 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2167693 Reviewed-by: Dylan Reid <dgreid@chromium.org> Tested-by: Dylan Reid <dgreid@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Dylan Reid <dgreid@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>
* cros_async: remove rustdoc inside macroDaniel Verkamp2020-04-26
| | | | | | | | | | | | | | Fixes clippy 1.43.0 "error: unused doc comment" ("rustdoc does not generate documentation for macros"). BUG=None TEST=bin/clippy Change-Id: If6b2d7bb3fb2752394faa7131fb306869aaa5a56 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2163785 Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
* Add a cros_async crate.Dylan Reid2020-02-10
This crate will house code using the new async/await features to be used by other parts of crosvm. Start the crate with a Future executor that runs tasks in a single thread and allows futures that block on system file descriptors. Change-Id: If77778ac056210dabbfc6e6e1e63df1c1b904a7f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1955045 Reviewed-by: Dylan Reid <dgreid@chromium.org> Tested-by: Dylan Reid <dgreid@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Dylan Reid <dgreid@chromium.org>