Skip to content

Commit fe1db59

Browse files
committed
Docs: note about combining RLock and signal handlers
1 parent 51a408e commit fe1db59

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Doc/library/threading.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,12 @@ the lock to an unlocked state and allows another thread blocked in
840840
must have a release in the thread that has acquired the lock. Failing to
841841
call release as many times the lock has been acquired can lead to deadlock.
842842

843+
.. tip::
844+
845+
Because lock acquisition can be interrupted by signals, sharing reentrant
846+
locks between :mod:`signal` handlers and the main thread can lead to
847+
surprising behavior. Therefore, this is generally not recommended.
848+
843849

844850
.. class:: RLock()
845851

0 commit comments

Comments
 (0)