Skip to content

Commit 26c52a6

Browse files
pablogsaltim-one
andauthored
Update Doc/library/functools.rst
Co-Authored-By: Tim Peters <[email protected]>
1 parent cf8a729 commit 26c52a6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Doc/library/functools.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,13 @@ The :mod:`functools` module defines the following functions:
586586
task_queue.put(node)
587587

588588
# When the work for a node is done, workers put the node in
589-
# 'finalized_tasks_queue' so we can get more nodes to work on
589+
# 'finalized_tasks_queue' so we can get more nodes to work on.
590+
# The definition of 'is_active()` guarantees that, at this point, at
591+
# least one node has been placed on 'task_queue' that hasn't yet
592+
# been passed to `done()`, so this blocking `get()` must (eventually)
593+
# succeed. After calling `done()`, we loop back to call `get_ready()`
594+
# again, so put newly freed nodes on 'task_queue' as soon as
595+
# logically possible.
590596
node = finalized_tasks_queue.get()
591597

592598
topological_sorter.done(node)

0 commit comments

Comments
 (0)