Skip to content

Commit

Permalink
Don't force a wake to despawn
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Dec 17, 2024
1 parent a011f48 commit aa5b909
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion embassy-executor/src/raw/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ impl<F: Future + 'static> TaskStorage<F> {
let mut cx = Context::from_waker(&waker);
match future.poll(&mut cx) {
Poll::Ready(_) => {
waker.wake_by_ref();
this.raw.state.despawn();

// As the future has finished and this function will not be called
// again, we can safely drop the future here.
Expand Down
3 changes: 0 additions & 3 deletions embassy-executor/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ fn executor_task() {
&[
"pend", // spawning a task pends the executor
"poll task1", // poll only once.
"pend", // task is done, wakes itself to exit
]
)
}
Expand Down Expand Up @@ -180,7 +179,6 @@ fn waking_after_completion_does_not_poll() {
"pend", // manual wake, single pend for two wakes
"pend", // respawning a task pends the executor
"poll task1", //
"pend", // task is done, wakes itself to exit
]
)
}
Expand Down Expand Up @@ -268,7 +266,6 @@ fn waking_with_old_waker_after_respawn() {
"yield_now", //
"pend", // manual wake, gets cleared by poll
"poll task1", //
"pend", // task is done, wakes itself to exit
]
);
}
Expand Down

0 comments on commit aa5b909

Please sign in to comment.