From 952bb5c431cafc4412dae5c143457fd9d1c0107b Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Sun, 12 Jun 2022 21:24:26 +0200 Subject: [PATCH] Restart executor on finish if there are retries --- macros/src/codegen/dispatchers.rs | 22 ++++++++++++++-------- src/export.rs | 9 ++++++--- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/macros/src/codegen/dispatchers.rs b/macros/src/codegen/dispatchers.rs index e6caa78196..1d1a4fb8af 100644 --- a/macros/src/codegen/dispatchers.rs +++ b/macros/src/codegen/dispatchers.rs @@ -164,12 +164,6 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec Vec bool { if let Some(future) = &mut self.task { unsafe { let waker = Waker::from_raw(RawWaker::new(wake as *const (), &WAKER_VTABLE)); @@ -75,10 +75,13 @@ pub mod executor { match future.poll(&mut cx) { Poll::Ready(_) => { self.task = None; + true // Only true if we finished now } - Poll::Pending => {} - }; + Poll::Pending => false, + } } + } else { + false } } }