On Mon May 5 13:35:53 2025 +0000, Jinoh Kang wrote:
To be fair I have never seen anyone get async states right the first time, even I was bit by the haze that is the state flags. Maybe this is a strong argument that the async state machinery finally needs to be reworked.
Well, it's not really about the `signaled` meaning, but about resetting it arbitrarily just so that the cancelling thread can wait on it.
After the async has been changed to one of the "signaled" state, it's probably not supposed to go back to a state where it's not signaled. Mapping this to your state machine it's not a valid state transition as it wasn't done anywhere.