summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-04-19 21:58:51 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-04-19 21:58:51 (GMT)
commit754851f456d0b97c86f2d700e032632323840e29 (patch)
tree366726362ecd8a4849b9fc402eddf6fb2acbf9a5 /Doc
parentcf2a807831ee93ef39e73fcc682894b0695b6143 (diff)
downloadcpython-754851f456d0b97c86f2d700e032632323840e29.zip
cpython-754851f456d0b97c86f2d700e032632323840e29.tar.gz
cpython-754851f456d0b97c86f2d700e032632323840e29.tar.bz2
Issue #11223: Add threading._info() function providing informations about the
thread implementation. Skip test_lock_acquire_interruption() and test_rlock_acquire_interruption() of test_threadsignals if a thread lock is implemented using a POSIX mutex and a POSIX condition variable. A POSIX condition variable cannot be interrupted by a signal (e.g. on Linux, the futex system call is restarted).
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/threading.rst24
-rw-r--r--Doc/whatsnew/3.3.rst8
2 files changed, 32 insertions, 0 deletions
diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst
index df47045..dd2226d 100644
--- a/Doc/library/threading.rst
+++ b/Doc/library/threading.rst
@@ -175,6 +175,30 @@ This module defines the following functions and objects:
Availability: Windows, systems with POSIX threads.
+.. function:: _info()
+
+ Return a dictionary with informations about the thread implementation.
+ The ``'name'`` key gives the name of the thread implementation (string):
+
+ * ``'nt'``: Windows threads
+ * ``'os2'``: OS/2 threads
+ * ``'pthread'``: POSIX threads
+ * ``'solaris'``: Solaris threads
+
+ POSIX threads have two more keys:
+
+ * ``'lock_implementation'`` (string): name of the lock
+ implementation
+
+ * ``'semaphore'``: a lock uses a semaphore
+ * ``'mutex+cond'``: a lock uses a mutex and a condition variable
+
+ * ``'pthread_version'`` (string, optional): name and version of the pthread
+ library
+
+ .. versionadded:: 3.3
+
+
This module also defines the following constant:
.. data:: TIMEOUT_MAX
diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst
index 602b2b7..d3c9a97 100644
--- a/Doc/whatsnew/3.3.rst
+++ b/Doc/whatsnew/3.3.rst
@@ -112,6 +112,14 @@ connection when done::
(Contributed by Giampaolo RodolĂ  in :issue:`9795`)
+threading
+---------
+
+* The :mod:`threading` module has a new :func:`~threading._info` function which
+ provides informations about the thread implementation.
+
+ (:issue:`11223`)
+
Optimizations
=============