gh-125058: update _thread docs regarding interruptibility of lock.acquire() (#125141)

This commit is contained in:
Jan Kaliszewski 2024-10-11 10:15:46 +02:00 committed by GitHub
parent b12e99261e
commit 0135848059
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View 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 * Calling :func:`sys.exit` or raising the :exc:`SystemExit` exception is
equivalent to calling :func:`_thread.exit`. equivalent to calling :func:`_thread.exit`.
* It is not possible to interrupt the :meth:`~threading.Lock.acquire` method on * It is platform-dependent whether the :meth:`~threading.Lock.acquire` method
a lock --- the :exc:`KeyboardInterrupt` exception will happen after the lock on a lock can be interrupted (so that the :exc:`KeyboardInterrupt` exception
has been acquired. 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 * When the main thread exits, it is system defined whether the other threads
survive. On most systems, they are killed without executing survive. On most systems, they are killed without executing