You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let delay = Delay::new(Duration::from_secs(10));
thread::sleep(5);
delay.reset(Duration::from_secs(0));assert_eq!(delay.poll_unpin(...),Poll::Ready(()));
Will spuriously fail on line 4, because resetting the Delay to 0 doesn't guarantee that it's immediately ready. While this makes sense if the 0-duration timer is unconditionally scheduled onto the thread, I found it a bit surprising; could a guarantee be established that this code passes?
The text was updated successfully, but these errors were encountered:
@Lucretiel Thanks for opening this issue. I think what you're proposing sounds reasonable!. If you'd be willing to write a patch and a test for it, I'd be happy to review + merge!
Unfortunately this ended up being nontrivial; I wasn't confident enough in how the bit flags were being manipulated to implement this. I'll leave the issue open but right now I'm not going to be the one to implement it.
Currently, the following pesudocode:
Will spuriously fail on line 4, because resetting the
Delay
to 0 doesn't guarantee that it's immediately ready. While this makes sense if the 0-duration timer is unconditionally scheduled onto the thread, I found it a bit surprising; could a guarantee be established that this code passes?The text was updated successfully, but these errors were encountered: