On Wed Mar 13 14:39:24 2024 +0000, Yuxuan Shui wrote:
This is difficult to trigger on Wine's side, because this particular wait only happens with a race condition: if the callback starts after we have found the item in `queue_cancel_item`, but before we close the tp object. It's probably the same on Windows' side, it would difficult to derive a unambiguous conclusion. If we don't see `MFCancelWorkItem` block, maybe Windows does not block, maybe we just didn't hit the race condition. I think it's not worth it to match Windows in a race condition.
I meant to test that MFCancelWorkItem() is a blocking call. Not to test the race condition. You can create a work item that fires an event after it gets started and then Sleeps(1s). And you wait for the event to be fired in the main thread, then call MFCancelWorkItem(), and time it and check if it takes ~1s for MFCancelWorkItem() to finish.