Skip to content

Commit 02b503e

Browse files
committed
AtomicWaker: take and wake
1 parent 52e4c7c commit 02b503e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

embassy-sync/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
- AtomicWaker now drops the Waker after waking it.
11+
1012
## 0.6.2 - 2025-01-15
1113

1214
- Add dynamic dispatch variant of `Pipe`.

embassy-sync/src/waitqueue/atomic_waker.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ impl<M: RawMutex> GenericAtomicWaker<M> {
3333
/// Wake the registered waker, if any.
3434
pub fn wake(&self) {
3535
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();
3938
}
4039
})
4140
}

0 commit comments

Comments
 (0)