-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-69702: Fix Condition._is_owned() is when using threading.Lock #2681
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
base: main
Are you sure you want to change the base?
Conversation
threading.Condition._is_owned() fails when condition is held by another thread. Replace lock's locked bit with thread id and implement _is_owned in_thread and _dummy_thread modules.
Tests pass on Fedora 25 Fedora 26[1], FreeBSD 10.3, FreeBSD 11.0. [1] On Fedora 26 test_alpn_protocols (test.test_ssl.ThreadedTests) fails, but it does
|
The tests error not related, see http://bugs.python.org/issue30714 |
Ping |
Can someone review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test_threading passes.
Also, I see
>>> cond = threading.Condition(threading.Lock())
>>> threading.Thread(target=cond.acquire).start()
>>> cond._is_owned()
False
This PR is stale because it has been open for 30 days with no activity. |
This PR is stale because it has been open for 30 days with no activity. |
This PR is stale because it has been open for 30 days with no activity. |
I hope it will unblock the GitHub built-in merge resolver.
@nirs Could you resolve the merge conflict, please? I got confused resolving |
Sure, but will take some time. |
This PR is stale because it has been open for 30 days with no activity. |
threading.Condition._is_owned() fails when condition is held by another
thread. Replace lock's locked bit with thread id and implement
_is_owned in_thread and _dummy_thread modules.
https://bugs.python.org/issue25516