Skip to content

gh-134323: Fix the new threading.RLock.locked method #134368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 22, 2025

Conversation

YvesDup
Copy link
Contributor

@YvesDup YvesDup commented May 20, 2025

This method should call the private locked method of _block attribute instead the private _count attribute which is reserved for counting recursive call of acquire/release.

The fix also concerns the _thread module in the rlock_locked function.

@colesbury colesbury requested a review from mpage May 20, 2025 20:43
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @sobolevn who added this locked() method.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the multiple updates :-)

@vstinner vstinner added the needs backport to 3.14 bugs and security fixes label May 22, 2025
@vstinner vstinner enabled auto-merge (squash) May 22, 2025 13:45
@vstinner vstinner merged commit 3effede into python:main May 22, 2025
45 checks passed
@miss-islington-app
Copy link

Thanks @YvesDup for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 22, 2025
…H-134368)

(cherry picked from commit 3effede)

Co-authored-by: Duprat <[email protected]>
Co-authored-by: Kumar Aditya <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented May 22, 2025

GH-134510 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label May 22, 2025
@vstinner
Copy link
Member

Merged, thanks for the fix.

vstinner pushed a commit that referenced this pull request May 22, 2025
) (#134510)

gh-134323: Fix the new `threading.RLock.locked` method (GH-134368)
(cherry picked from commit 3effede)

Co-authored-by: Duprat <[email protected]>
Co-authored-by: Kumar Aditya <[email protected]>
@YvesDup
Copy link
Contributor Author

YvesDup commented May 22, 2025

LGTM. Thanks for the multiple updates :-)

Thank's all for your comments

@YvesDup YvesDup deleted the rlock-threading-locked-failed branch May 22, 2025 16:15
lkollar pushed a commit to lkollar/cpython that referenced this pull request May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants