mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-01-19 05:43:55 +01:00
05535913b3
In a synchronous `BackgroundProcessor`, the exit is done by setting an atomic flag, which is most likely to happen while we're asleep. Thus, we previously checked for the exit condition after the sleep (and after we persisted the `ChannelManager`, if required, though this is no longer required and dates back to when we didn't do a re-persist after breaking out of the main loop). For an async `background-processor`, this is also fine, however because of the relatively longer sleep time, if the exit flag is set via a sleep check returning true during event processing, we may end up delaying exit rather substantially. In order to avoid this, we simply check for the exit condition both before and immediately after the sleep in `background-processor`. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |