We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d5481b9 commit 0e7e9b7Copy full SHA for 0e7e9b7
lightning/src/util/wakers.rs
@@ -262,7 +262,7 @@ impl Sleeper {
262
if let Some(notified_fut) = notified_fut_lck.take() {
263
break notified_fut;
264
}
265
- let sleep_time = max_wait.saturating_sub(start_time.elapsed());
+ let sleep_time = max_wait.checked_sub(start_time.elapsed()).unwrap_or(Duration::from_secs(0));
266
if sleep_time == Duration::from_secs(0) { return false; }
267
notified_fut_lck = cv.wait_timeout(notified_fut_lck, max_wait).unwrap().0;
268
0 commit comments