]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Remove print race from task_done example. (GH-31795)
authorRaymond Hettinger <rhettinger@users.noreply.github.com>
Thu, 10 Mar 2022 17:01:23 +0000 (11:01 -0600)
committerGitHub <noreply@github.com>
Thu, 10 Mar 2022 17:01:23 +0000 (11:01 -0600)
Doc/library/queue.rst

index 0ec5900bef5bbff6da218e066b9d4f1ac8998876..cbf27d2bb10d04283366174f83a0469ca008309c 100644 (file)
@@ -201,15 +201,14 @@ Example of how to wait for enqueued tasks to be completed::
             print(f'Finished {item}')
             q.task_done()
 
-    # turn-on the worker thread
+    # Turn-on the worker thread.
     threading.Thread(target=worker, daemon=True).start()
 
-    # send thirty task requests to the worker
+    # Send thirty task requests to the worker.
     for item in range(30):
         q.put(item)
-    print('All task requests sent\n', end='')
 
-    # block until all tasks are done
+    # Block until all tasks are done.
     q.join()
     print('All work completed')