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).
This commit is contained in:
Victor Stinner 2011-04-19 23:58:51 +02:00
parent cf2a807831
commit 754851f456
10 changed files with 150 additions and 18 deletions

View file

@ -27,12 +27,15 @@ except ImportError:
# and unmaintained) linuxthreads threading library. There's an issue
# when combining linuxthreads with a failed execv call: see
# http://bugs.python.org/issue4970.
if (hasattr(os, "confstr_names") and
"CS_GNU_LIBPTHREAD_VERSION" in os.confstr_names):
libpthread = os.confstr("CS_GNU_LIBPTHREAD_VERSION")
USING_LINUXTHREADS= libpthread.startswith("linuxthreads")
else:
USING_LINUXTHREADS= False
USING_LINUXTHREADS = False
if threading:
info = threading._info()
try:
pthread_version = info['pthread_version']
except KeyError:
pass
else:
USING_LINUXTHREADS = pthread_version.startswith("linuxthreads")
# Tests creating TESTFN
class FileTests(unittest.TestCase):