You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This appears to have a race condition. The new thread might start waiting only after the handle has been closed. This could be fixed by making the thread close the cancel_handle.
Hmm, I think you're right. Probably difficult to hit, but not impossible.
I don't think the simple fix is quite right either though – if we move the CloseHandle into the thread, then we introduce the possibility that the handle will already be closed before we try to SetEvent in the finally block.
I guess we could use some kind of reference counting scheme, where whichever of the child thread/main thread exits last is the one who calls CloseHandle?
https://github.com/python-trio/trio/pull/575/files#diff-ed34813c30595dc83bb2a66e0973e22dR54
This appears to have a race condition. The new thread might start waiting only after the handle has been closed. This could be fixed by making the thread close the
cancel_handle
.Originally posted by @GSPP in #233 (comment)
The text was updated successfully, but these errors were encountered: