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

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:17 +01:00 committed by GitHub
parent ac9e9e2c8f
commit fdbdd9fb5c
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
---------------