From: Robsdedude Date: Thu, 12 Feb 2026 23:15:23 +0000 (+0100) Subject: gh-144706: Warn against using synchronization primitives within signal handlers ... X-Git-Tag: v3.15.0a7~292 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=945bf8ce1bf7ee3881752c2ecc129e35ab818477;p=thirdparty%2FPython%2Fcpython.git gh-144706: Warn against using synchronization primitives within signal handlers (GH-144736) --- diff --git a/Doc/library/signal.rst b/Doc/library/signal.rst index d85d71389110..c3fe9943ba9d 100644 --- a/Doc/library/signal.rst +++ b/Doc/library/signal.rst @@ -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 ---------------