File tree 3 files changed +5
-6
lines changed
3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -156,8 +156,7 @@ fn waking_after_completion_does_not_poll() {
156
156
let ( executor, trace) = setup ( ) ;
157
157
executor. spawner ( ) . spawn ( task1 ( trace. clone ( ) , waker) ) . unwrap ( ) ;
158
158
159
- unsafe { executor. poll ( ) } ;
160
- waker. wake ( ) ;
159
+ // Task registers waker, then exits
161
160
unsafe { executor. poll ( ) } ;
162
161
163
162
// Exited task may be waken but is not polled
@@ -176,7 +175,6 @@ fn waking_after_completion_does_not_poll() {
176
175
"pend" , // spawning a task pends the executor
177
176
"poll task1" , //
178
177
"pend" , // manual wake, gets cleared by poll
179
- "pend" , // manual wake, single pend for two wakes
180
178
"pend" , // respawning a task pends the executor
181
179
"poll task1" , //
182
180
]
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## Unreleased
9
9
10
+ - AtomicWaker now drops the Waker after waking it.
11
+
10
12
## 0.6.2 - 2025-01-15
11
13
12
14
- Add dynamic dispatch variant of ` Pipe ` .
Original file line number Diff line number Diff line change @@ -33,9 +33,8 @@ impl<M: RawMutex> GenericAtomicWaker<M> {
33
33
/// Wake the registered waker, if any.
34
34
pub fn wake ( & self ) {
35
35
self . waker . lock ( |cell| {
36
- if let Some ( w) = cell. replace ( None ) {
37
- w. wake_by_ref ( ) ;
38
- cell. set ( Some ( w) ) ;
36
+ if let Some ( w) = cell. take ( ) {
37
+ w. wake ( ) ;
39
38
}
40
39
} )
41
40
}
You can’t perform that action at this time.
0 commit comments