File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -94,13 +94,13 @@ impl Notifier {
94
94
future_probably_generated_calls |= Arc :: strong_count ( & future_state) > 1 ;
95
95
}
96
96
if !future_probably_generated_calls {
97
- // If a future made some callbacks or still exists (i.e. the state has more than the
98
- // one reference we hold), assume the user was notified and skip the "classic"
99
- // waiters .
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
100
lock. 0 = true ;
101
101
}
102
102
mem:: drop ( lock) ;
103
- self . condvar . notify_all ( ) ;
103
+ if !future_probably_generated_calls { self . condvar . notify_all ( ) ; }
104
104
}
105
105
106
106
/// Gets a [`Future`] that will get woken up with any waiters
You can’t perform that action at this time.
0 commit comments