Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion 3 Doc/library/threading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 8 additions & 0 deletions 8 Lib/test/test_threadsignals.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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')
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.