Skip to content

Commit 21cc735

Browse files
committed
Move warning to signal module and rephrase
1 parent 57ce53f commit 21cc735

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

Doc/library/signal.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ 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` must not be shared
74+
between between signal handlers and other threads.
75+
Because blocking synchronization calls can be interrupted by signals,
76+
such sharing can lead to surprising dead locks.
77+
7178

7279
Module contents
7380
---------------

Doc/library/threading.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@ level :mod:`_thread` module.
1313

1414
.. include:: ../includes/wasm-notavail.rst
1515

16-
.. warning::
17-
18-
Syncrhonization primitives must not be shared between between :mod:`signal`
19-
handlers and the main thread.
20-
Because blocking syncrhonizations calls can be interrupted by signals,
21-
such sharing can lead to surprising dead locks.
22-
23-
2416
Introduction
2517
------------
2618

0 commit comments

Comments
 (0)