File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -288,13 +288,21 @@ impl Handle {
288288 self . process_at_time ( now)
289289 }
290290
291- pub ( self ) fn process_at_time ( & self , now : u64 ) {
291+ pub ( self ) fn process_at_time ( & self , mut now : u64 ) {
292292 let mut waker_list: [ Option < Waker > ; 32 ] = Default :: default ( ) ;
293293 let mut waker_idx = 0 ;
294294
295295 let mut lock = self . get ( ) . lock ( ) ;
296296
297- assert ! ( now >= lock. elapsed) ;
297+ if now < lock. elapsed {
298+ // Time went backwards! This normally shouldn't happen as the Rust language
299+ // guarantees that an Instant is monotonic, but can happen when running
300+ // Linux in a VM on a Windows host due to std incorrectly trusting the
301+ // hardware clock to be monotonic.
302+ //
303+ // See <https://github.com/tokio-rs/tokio/issues/3619> for more information.
304+ now = lock. elapsed ;
305+ }
298306
299307 while let Some ( entry) = lock. wheel . poll ( now) {
300308 debug_assert ! ( unsafe { entry. is_pending( ) } ) ;
You can’t perform that action at this time.
0 commit comments