Skip to content

gh-153020: Fix race condition on event_tstate in _tkinter#153640

Open
tangyuan0821 wants to merge 2 commits into
python:mainfrom
tangyuan0821:153020
Open

gh-153020: Fix race condition on event_tstate in _tkinter#153640
tangyuan0821 wants to merge 2 commits into
python:mainfrom
tangyuan0821:153020

Conversation

@tangyuan0821

@tangyuan0821 tangyuan0821 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

event_tstate in Modules/_tkinter.c is read by the EventHook thread and
written 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant