mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-01-18 21:34:48 +01:00
Ensure background-processor
exits after any sleep future says to
If the user's sleep future passed to an async background processor only returns true for exiting once and then reverts back to false, we should exit anyway when we get a chance to. We do to this here by always ensuring we check the exit flag even when only polling sleep futures with no intent to (yet) exit. This is utilized in the tests added in the coming commit(s).
This commit is contained in:
parent
8676c5aa4e
commit
ca367f5d08
@ -554,7 +554,10 @@ where
|
||||
|fut: &mut SleepFuture, _| {
|
||||
let mut waker = dummy_waker();
|
||||
let mut ctx = task::Context::from_waker(&mut waker);
|
||||
core::pin::Pin::new(fut).poll(&mut ctx).is_ready()
|
||||
match core::pin::Pin::new(fut).poll(&mut ctx) {
|
||||
task::Poll::Ready(exit) => { should_break = exit; true },
|
||||
task::Poll::Pending => false,
|
||||
}
|
||||
}, mobile_interruptable_platform)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user