From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 11 Oct 2024 08:22:34 +0000 (+0200) Subject: [3.12] gh-125058: update `_thread` docs regarding interruptibility of `lock.acquire... X-Git-Tag: v3.12.8~228 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4c40381023df1319661b27f4ab65075569532c73;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-125058: update `_thread` docs regarding interruptibility of `lock.acquire()` (GH-125141) (#125307) gh-125058: update `_thread` docs regarding interruptibility of `lock.acquire()` (GH-125141) (cherry picked from commit 0135848059162ad81478a7776fec622d68a36524) Co-authored-by: Jan Kaliszewski --- diff --git a/Doc/library/_thread.rst b/Doc/library/_thread.rst index d82f63834dd2..e5cbff0b1ef4 100644 --- a/Doc/library/_thread.rst +++ b/Doc/library/_thread.rst @@ -216,9 +216,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