Skip to content

Commit fdbdd9f

Browse files
[3.14] gh-144706: Warn against using synchronization primitives within signal handlers (GH-144736) (GH-144767)
gh-144706: Warn against using synchronization primitives within signal handlers (GH-144736) (cherry picked from commit 945bf8c) Co-authored-by: Robsdedude <dev@rouvenbauer.de>
1 parent ac9e9e2 commit fdbdd9f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Doc/library/signal.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ the synchronization primitives from the :mod:`threading` module instead.
6868

6969
Besides, only the main thread of the main interpreter is allowed to set a new signal handler.
7070

71+
.. warning::
72+
73+
Synchronization primitives such as :class:`threading.Lock` should not be used
74+
within signal handlers. Doing so can lead to unexpected deadlocks.
75+
7176

7277
Module contents
7378
---------------

0 commit comments

Comments
 (0)