Skip to content

Commit

Permalink
gh-125058: update _thread docs regarding interruptibility of `lock.…
Browse files Browse the repository at this point in the history
…acquire()` (#125141)
  • Loading branch information
zuo authored Oct 11, 2024
1 parent b12e992 commit 0135848
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Doc/library/_thread.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0135848

Please sign in to comment.