https://github.com/python/cpython/commit/38440549dbddbbaab2092126d2437e4aa0114b4a
commit: 38440549dbddbbaab2092126d2437e4aa0114b4a
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: picnixz <[email protected]>
date: 2026-03-09T16:36:00Z
summary:

[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 171133aa84cd2fa8738bdbb0c76435645810e8d3)

Co-authored-by: Yashraj <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>

files:
M Doc/library/concurrent.futures.rst

diff --git a/Doc/library/concurrent.futures.rst 
b/Doc/library/concurrent.futures.rst
index 3ea24ea77004ad..a32c3828313454 100644
--- a/Doc/library/concurrent.futures.rst
+++ b/Doc/library/concurrent.futures.rst
@@ -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=())

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to