gh-69702: Fix Condition._is_owned() is when using threading.Lock#2681
gh-69702: Fix Condition._is_owned() is when using threading.Lock#2681nirs wants to merge 2 commits intopython:mainfrom
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? |
MaxwellDupre
left a comment
There was a problem hiding this comment.
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