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

gh-144706: Warn against using synchronization primitives within signal handlers (GH-144736)
(cherry picked from commit 945bf8ce1b)

Co-authored-by: Robsdedude <dev@rouvenbauer.de>
This commit is contained in:
Miss Islington (bot) 2026-02-13 00:21:26 +01:00 committed by GitHub
parent 2f354107f3
commit 99a4e55f79
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
---------------