Skip to content

gh-122201: Lock mutex when setting handling_thread to NULL#122204

Merged
colesbury merged 1 commit into
python:mainfrom
colesbury:gh-122201-pending-calls
Jul 26, 2024
Merged

gh-122201: Lock mutex when setting handling_thread to NULL#122204
colesbury merged 1 commit into
python:mainfrom
colesbury:gh-122201-pending-calls

Conversation

@colesbury

@colesbury colesbury commented Jul 23, 2024

Copy link
Copy Markdown
Contributor

In the free-threaded build, we need to lock pending->mutex when clearing the handling_thread in order to avoid a race with a concurrent make_pending_calls() from the same interpreter.

In the free-threaded build, we need to lock pending->mutex when clearing
the handling_thread in order not to race with a concurrent
make_pending_calls in the same interpreter.
@colesbury colesbury merged commit c557ae9 into python:main Jul 26, 2024
@miss-islington-app

Copy link
Copy Markdown

Thanks @colesbury for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@colesbury colesbury deleted the gh-122201-pending-calls branch July 26, 2024 17:06
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 26, 2024
…honGH-122204)

In the free-threaded build, we need to lock pending->mutex when clearing
the handling_thread in order not to race with a concurrent
make_pending_calls in the same interpreter.
(cherry picked from commit c557ae9)

Co-authored-by: Sam Gross <colesbury@gmail.com>
@bedevere-app

bedevere-app Bot commented Jul 26, 2024

Copy link
Copy Markdown

GH-122319 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jul 26, 2024
colesbury added a commit that referenced this pull request Jul 26, 2024
…-122204) (#122319)

In the free-threaded build, we need to lock pending->mutex when clearing
the handling_thread in order not to race with a concurrent
make_pending_calls in the same interpreter.
(cherry picked from commit c557ae9)

Co-authored-by: Sam Gross <colesbury@gmail.com>
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.

2 participants