gh-152798: update sys.thread_info.lock documentation t match implemen…#153263
Conversation
Documentation build overview
|
| * ``"mutex+cond"``: a lock uses a mutex and a condition variable | ||
| * ``None`` if this information is unknown | ||
| * ``"pymutex"``: a lock uses the PyMutex implementation | ||
| * ``None`` if the lock implementation is not exposed (e.g. : on Windows and WASI) |
There was a problem hiding this comment.
Please keep semaphore and mutex+cond in the documentation. It's useful to understand Python 3.14 and older values.
The lock is not None on Windows, but pymutex. Example from test.pythoninfo: https://buildbot.python.org/#/builders/1620/builds/3968
sys.thread_info: sys.thread_info(name='nt', lock='pymutex', version=None)
I also see pymutex on a WASI buildbot: https://buildbot.python.org/#/builders/1046/builds/12356
sys.thread_info: sys.thread_info(name='pthread', lock='pymutex', version=None)
Same on Emscripten: https://buildbot.python.org/#/builders/1810/builds/3145
sys.thread_info: sys.thread_info(name='pthread-stubs', lock='pymutex', version=None)
There was a problem hiding this comment.
thanks for the details and i've kept the historical values and removed the incorrect None on Windows / WASI mention.
and now it reflects that pymutex is used across all platforms from 3.15 onward. PTAL.
| * ``"mutex+cond"``: a lock uses a mutex and a condition variable | ||
| * ``"semaphore"``: a lock uses a semaphore (Python 3.14 and older) | ||
| * ``"mutex+cond"``: a lock uses a mutex and a condition variable (Python 3.14 and older) | ||
| * ``"pymutex"``: a lock uses the PyMutex implementation (Python 3.15 and newer) |
There was a problem hiding this comment.
We should link to :c:type:`PyMutex` here.
There was a problem hiding this comment.
i added :c:type: link to PyMutex just as suggested
|
Thanks @Wojusensei for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
|
GH-153276 is a backport of this pull request to the 3.15 branch. |
this PR updates the documentation for “sys.thread_info.lock” to reflect what the code actually returns today
the code currently returns "pymutex" on POSIX platforms ( except Windows and WASI, where it returns None ), but the docs still described the old "semaphore" and "mutex+cond" values
as discussed in the issue the consensus is that it's too late to change the code behavior, but the documentation should be corrected to avoid confusion
(no code changes are made here and only docs)
Closes gh-152798.