[3.14] gh-141617: clarify concurrent.futures.ThreadPoolExecutor deadlock example (GH-141620) (#145686)

gh-141617: clarify `concurrent.futures.ThreadPoolExecutor` deadlock example (GH-141620)

---------
(cherry picked from commit 171133aa84)

Co-authored-by: Yashraj <yashrajpala8@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2026-03-09 17:36:00 +01:00 committed by GitHub
parent 778ff23689
commit 38440549db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -156,7 +156,9 @@ And::
print(f.result())
executor = ThreadPoolExecutor(max_workers=1)
executor.submit(wait_on_future)
future = executor.submit(wait_on_future)
# Note: calling future.result() would also cause a deadlock because
# the single worker thread is already waiting for wait_on_future().
.. class:: ThreadPoolExecutor(max_workers=None, thread_name_prefix='', initializer=None, initargs=())