gh-153020: Fix race condition on event_tstate in _tkinter#153640
gh-153020: Fix race condition on event_tstate in _tkinter#153640tangyuan0821 wants to merge 3 commits into
Conversation
ByteFlowing1337
left a comment
There was a problem hiding this comment.
If the race is only possible in FT, why not use macros like FT_ATOMIC_LOAD_PTR or FT_ATOMIC_STORE_PTR to avoid the potential performance overhead in the default build?
Good catch, switched to FT_ATOMIC_* since the race is only under free-threading. The default build just reads and writes it directly. |
ByteFlowing1337
left a comment
There was a problem hiding this comment.
The suffix of the news entry filename looks incorrect. It should be a nonce generated by blurb, see https://devguide.python.org/getting-started/pull-request-lifecycle/#how-to-add-a-news-entry.
…ventTs.rst Co-authored-by: Ivy Xu <ivyxu1337@gmail.com>
event_tstatein Modules/_tkinter.c is read by the EventHook thread andwritten by the main thread, so they race. I load and store it with atomic
ops, and clear it to NULL in DisableEventHook before the PyThreadState is
released.
event_tstatein_tkinter.cunder free-threading #153020