https://github.com/python/cpython/commit/171133aa84cd2fa8738bdbb0c76435645810e8d3 commit: 171133aa84cd2fa8738bdbb0c76435645810e8d3 branch: main author: Yashraj <[email protected]> committer: picnixz <[email protected]> date: 2026-03-09T16:30:00Z summary:
gh-141617: clarify `concurrent.futures.ThreadPoolExecutor` deadlock example (#141620) --------- 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]
