KEMBAR78
gh-134323: Fix the new `threading.RLock.locked` method by YvesDup · Pull Request #134368 · python/cpython · GitHub
Skip to content

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.

YvesDup and others added 2 commits May 21, 2025 18:15
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
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 <yduprat@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
@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 <yduprat@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
@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
…134368)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
…134368)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
…134368)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
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