Pass the EventLoopRuntime by value
Now that the EventLoopRuntime simply wraps a &CppEventLoopRuntime,
we can make give the spawned task an owned EventLoopRuntime. This means
that the spawned future can now own and use the EventLoopRuntime within it.
This is safe because as long as the EventLoop exists, so does the
CppEventLoopRuntime.
Change-Id: Iccaa6373fdb9d61a7995758f7b99906275f18c99
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/events/simulated_event_loop.rs b/aos/events/simulated_event_loop.rs
index 96c4e7e..e050893 100644
--- a/aos/events/simulated_event_loop.rs
+++ b/aos/events/simulated_event_loop.rs
@@ -91,7 +91,7 @@
fun: F,
) -> EventLoopRuntimeHolder<SimulatedEventLoopHolder>
where
- F: for<'event_loop> FnOnce(&mut EventLoopRuntime<'event_loop>),
+ F: for<'event_loop> FnOnce(EventLoopRuntime<'event_loop>),
{
let event_loop = self.make_event_loop(name, node);
// SAFETY: We just created this EventLoop, so we are the exclusive owner of it.