https://github.com/python/cpython/commit/945bf8ce1bf7ee3881752c2ecc129e35ab818477
commit: 945bf8ce1bf7ee3881752c2ecc129e35ab818477
branch: main
author: Robsdedude <[email protected]>
committer: ZeroIntensity <[email protected]>
date: 2026-02-12T18:15:23-05:00
summary:

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

files:
M Doc/library/signal.rst

diff --git a/Doc/library/signal.rst b/Doc/library/signal.rst
index d85d7138911016..c3fe9943ba9d76 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
 ---------------

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to