]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-144706: Warn against using synchronization primitives within signal handler...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 12 Feb 2026 23:21:17 +0000 (00:21 +0100)
committerGitHub <noreply@github.com>
Thu, 12 Feb 2026 23:21:17 +0000 (23:21 +0000)
gh-144706: Warn against using synchronization primitives within signal handlers (GH-144736)
(cherry picked from commit 945bf8ce1bf7ee3881752c2ecc129e35ab818477)

Co-authored-by: Robsdedude <dev@rouvenbauer.de>
Doc/library/signal.rst

index 995f800528f376edd0e26f9d5599a3a226b3f9a9..41a08fb165e2b675b596ef5f170b5c30b27d4082 100644 (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
 ---------------