File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -93,14 +93,16 @@ impl Notifier {
93
93
future_probably_generated_calls |= future_state. lock ( ) . unwrap ( ) . complete ( ) ;
94
94
future_probably_generated_calls |= Arc :: strong_count ( & future_state) > 1 ;
95
95
}
96
- if !future_probably_generated_calls {
97
- // If no future made any callbacks and has been drop'd (i.e. the state has only the one
98
- // reference we hold), assume the user was not notified and set the
99
- // notification-required flag. This will cause the `wait` functions above to return.
100
- lock. 0 = true ;
96
+ if future_probably_generated_calls {
97
+ // If a future made some callbacks or has not yet been drop'd (i.e. the state has more
98
+ // than the one reference we hold), assume the user was notified and skip setting the
99
+ // notification-required flag. This will not cause the `wait` functions above to return
100
+ // and avoid any future `Future`s starting in a completed state.
101
+ return ;
101
102
}
103
+ lock. 0 = true ;
102
104
mem:: drop ( lock) ;
103
- if !future_probably_generated_calls { self . condvar . notify_all ( ) ; }
105
+ self . condvar . notify_all ( ) ;
104
106
}
105
107
106
108
/// Gets a [`Future`] that will get woken up with any waiters
You can’t perform that action at this time.
0 commit comments