From 99a4e55f79be815949d64e883847f3bafa93125b Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Fri, 13 Feb 2026 00:21:26 +0100 Subject: [PATCH] [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 945bf8ce1bf7ee3881752c2ecc129e35ab818477) Co-authored-by: Robsdedude --- Doc/library/signal.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/library/signal.rst b/Doc/library/signal.rst index 1a2a555f5c0..e37ca21d259 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 ---------------