summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorJan Kaliszewski <zuo@kaliszewski.net>2024-10-11 08:15:46 (GMT)
committerGitHub <noreply@github.com>2024-10-11 08:15:46 (GMT)
commit0135848059162ad81478a7776fec622d68a36524 (patch)
treeb3b455ca127fb2000e4fe915a50ea5594d1c2e26 /Doc
parentb12e99261e656585ffbaa395af7c5dbaee5ad1ad (diff)
downloadcpython-0135848059162ad81478a7776fec622d68a36524.zip
cpython-0135848059162ad81478a7776fec622d68a36524.tar.gz
cpython-0135848059162ad81478a7776fec622d68a36524.tar.bz2
gh-125058: update `_thread` docs regarding interruptibility of `lock.acquire()` (#125141)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/_thread.rst8
1 files changed, 5 insertions, 3 deletions
diff --git a/Doc/library/_thread.rst b/Doc/library/_thread.rst
index 5fd604c..6a66fc4 100644
--- a/Doc/library/_thread.rst
+++ b/Doc/library/_thread.rst
@@ -219,9 +219,11 @@ In addition to these methods, lock objects can also be used via the
* Calling :func:`sys.exit` or raising the :exc:`SystemExit` exception is
equivalent to calling :func:`_thread.exit`.
-* It is not possible to interrupt the :meth:`~threading.Lock.acquire` method on
- a lock --- the :exc:`KeyboardInterrupt` exception will happen after the lock
- has been acquired.
+* It is platform-dependent whether the :meth:`~threading.Lock.acquire` method
+ on a lock can be interrupted (so that the :exc:`KeyboardInterrupt` exception
+ will happen immediately, rather than only after the lock has been acquired or
+ the operation has timed out). It can be interrupted on POSIX, but not on
+ Windows.
* When the main thread exits, it is system defined whether the other threads
survive. On most systems, they are killed without executing