gh-144706: Warn against using synchronization primitives within signal handlers (GH-144736)

This commit is contained in:
Robsdedude 2026-02-13 00:15:23 +01:00 committed by GitHub
parent 66da7bf6fe
commit 945bf8ce1b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -68,6 +68,11 @@ the synchronization primitives from the :mod:`threading` module instead.
Besides, only the main thread of the main interpreter is allowed to set a new signal handler.
.. warning::
Synchronization primitives such as :class:`threading.Lock` should not be used
within signal handlers. Doing so can lead to unexpected deadlocks.
Module contents
---------------