File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -290,12 +290,18 @@ nonpoison_and_poison_unwrap_test!(
290290 cond. notify_all( ) ;
291291 } ) ;
292292
293- let guard = maybe_unwrap( sent. lock( ) ) ;
294- // If there is internal overflow, this call will return almost
295- // immediately, before the other thread has reached the `notify_all`
296- let ( guard, res) = maybe_unwrap( cond. wait_timeout( guard, Duration :: from_secs( u64 :: MAX . div_ceil( 1_000_000_000 ) ) ) ) ;
297- assert!( !res. timed_out( ) ) ;
298- assert!( * guard) ;
293+ let mut guard = maybe_unwrap( sent. lock( ) ) ;
294+ loop {
295+ if * guard {
296+ break ;
297+ }
298+
299+ // If there is internal overflow, this call will return almost
300+ // immediately, before the other thread has reached the `notify_all`
301+ let ( g, res) = maybe_unwrap( cond. wait_timeout( guard, Duration :: from_secs( u64 :: MAX . div_ceil( 1_000_000_000 ) ) ) ) ;
302+ assert!( !res. timed_out( ) ) ;
303+ guard = g;
304+ }
299305 } )
300306 }
301307) ;
You can’t perform that action at this time.
0 commit comments