From 13c107e81582e2249df2fd940791b611a1ddbd62 Mon Sep 17 00:00:00 2001 From: Rasmus Melchior Jacobsen Date: Wed, 20 Dec 2023 13:09:16 +0100 Subject: [PATCH] Put waiting state back if any --- embassy-sync/src/signal.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/embassy-sync/src/signal.rs b/embassy-sync/src/signal.rs index 97d76b463..d75750ce7 100644 --- a/embassy-sync/src/signal.rs +++ b/embassy-sync/src/signal.rs @@ -117,7 +117,10 @@ where let state = cell.replace(State::None); match state { State::Signaled(res) => Some(res), - _ => None, + state => { + cell.set(state); + None + } } }) }