From 630da2ec1cbbdf6fbf5552998271f96132590c6f Mon Sep 17 00:00:00 2001 From: Arnold Loubriat Date: Tue, 9 Jun 2026 15:03:08 +0200 Subject: [PATCH] fix: Recheck condition in a loop to avoid spurious wakeups --- platforms/windows/src/tests/mod.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/platforms/windows/src/tests/mod.rs b/platforms/windows/src/tests/mod.rs index a2678323..10612da1 100644 --- a/platforms/windows/src/tests/mod.rs +++ b/platforms/windows/src/tests/mod.rs @@ -224,12 +224,10 @@ where }); let window = { - let state = window_mutex.lock().unwrap(); - let mut state = if state.is_none() { - window_cv.wait(state).unwrap() - } else { - state - }; + let mut state = window_mutex.lock().unwrap(); + while state.is_none() { + state = window_cv.wait(state).unwrap(); + } state.take().unwrap() };