On Mon May 11 12:45:06 2026 +0000, Charlotte Pabst wrote:
What I was saying is that the current code was already correct (matching windows) and does not need to be modified. Indeed, the test is not robust and works by chance (but it works almost always - I have not observed it failing). We are testing for WAIT_TIMEOUT - indicating that something has failed and the event was not set (because the handle was closed). This matches windows behavior. If I modify the code as you describe (I've tried this), we get WAIT_OBJECT_0 instead - which would be divergent from windows. Perhaps the test could be removed tho since it is theoretically unreliable, but it still serves to demonstrate this point. Ok, I see what you mean now.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9777#note_141651