crosvm/cros_async
Chirantan Ekbote 1e9974ff3e cros_async: Add the WeakWake trait
This is like future::task::ArcWake but uses Weak<T> instead of Arc<T>.
This prevents a circular reference where the RunnableQueue would hold an
active reference to the executor (via its waker) while the executor
owned the RunnableQueue, leading to memory leaks.

With this the executor should only be using weak references internally
and the only strong references should be in the public *Executor type.

Also fix the tests that were broken by this change.

BUG=none
TEST=unit tests

Change-Id: I3e9c007d533e154b2ad9d1e4d56a692f65da6aa0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2643841
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Chirantan Ekbote <chirantan@chromium.org>
Tested-by: Chirantan Ekbote <chirantan@chromium.org>
2021-01-25 08:52:27 +00:00
..
src cros_async: Add the WeakWake trait 2021-01-25 08:52:27 +00:00
.build_test_skip
Cargo.toml