]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-144706: Warn against using synchronization primitives within signal handlers ...
authorRobsdedude <dev@rouvenbauer.de>
Thu, 12 Feb 2026 23:15:23 +0000 (00:15 +0100)
committerGitHub <noreply@github.com>
Thu, 12 Feb 2026 23:15:23 +0000 (18:15 -0500)
Doc/library/signal.rst

index d85d7138911016aeb8276a85c06eb340b1f5521d..c3fe9943ba9d760f59ba71c17c92542c8799808a 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
 ---------------