]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-125058: update `_thread` docs regarding interruptibility of `lock.acquire()` ...
authorJan Kaliszewski <zuo@kaliszewski.net>
Fri, 11 Oct 2024 08:15:46 +0000 (10:15 +0200)
committerGitHub <noreply@github.com>
Fri, 11 Oct 2024 08:15:46 +0000 (13:45 +0530)
Doc/library/_thread.rst

index 5fd604c05380ac58486bffe32387b650a1fccbe0..6a66fc4c64bc450fc6e5b7a2a401f5edbc89eb63 100644 (file)
@@ -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