mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-20 14:55:30 +01:00
Restart executor on finish if there are retries
This commit is contained in:
parent
b2ec1fa651
commit
952bb5c431
2 changed files with 20 additions and 11 deletions
|
|
@ -65,7 +65,7 @@ pub mod executor {
|
|||
self.task = Some(future);
|
||||
}
|
||||
|
||||
pub fn poll(&mut self, wake: fn()) {
|
||||
pub fn poll(&mut self, wake: fn()) -> 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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue