Skip to content

Commit 945bf8c

Browse files
authored
gh-144706: Warn against using synchronization primitives within signal handlers (GH-144736)
1 parent 66da7bf commit 945bf8c

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)