diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst index b94021b4eb8f89..e6185c5b3a214c 100644 --- a/Doc/library/threading.rst +++ b/Doc/library/threading.rst @@ -400,7 +400,8 @@ All methods are executed atomically. The *timeout* parameter is new. .. versionchanged:: 3.2 - Lock acquires can now be interrupted by signals on POSIX. + Lock acquisition can now be interrupted by signals on POSIX if the + underlying threading implementation supports it. .. method:: release() diff --git a/Lib/test/test_threadsignals.py b/Lib/test/test_threadsignals.py index 1ad6c63fea2e35..7e13b1720f91e9 100644 --- a/Lib/test/test_threadsignals.py +++ b/Lib/test/test_threadsignals.py @@ -78,6 +78,10 @@ def alarm_interrupt(self, sig, frame): @unittest.skipIf(USING_PTHREAD_COND, 'POSIX condition variables cannot be interrupted') + @unittest.skipIf(sys.platform.startswith('linux') and + not sys.thread_info.version, + 'Issue 34004: musl does not allow interruption of locks ' + 'by signals.') # Issue #20564: sem_timedwait() cannot be interrupted on OpenBSD @unittest.skipIf(sys.platform.startswith('openbsd'), 'lock cannot be interrupted on OpenBSD') @@ -105,6 +109,10 @@ def test_lock_acquire_interruption(self): @unittest.skipIf(USING_PTHREAD_COND, 'POSIX condition variables cannot be interrupted') + @unittest.skipIf(sys.platform.startswith('linux') and + not sys.thread_info.version, + 'Issue 34004: musl does not allow interruption of locks ' + 'by signals.') # Issue #20564: sem_timedwait() cannot be interrupted on OpenBSD @unittest.skipIf(sys.platform.startswith('openbsd'), 'lock cannot be interrupted on OpenBSD')