]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-135730: Clarify multiprocessing.Queue close() documentation (#136803)
authoraggshruti99 <aggshruti99@gmail.com>
Sat, 19 Jul 2025 12:24:39 +0000 (13:24 +0100)
committerGitHub <noreply@github.com>
Sat, 19 Jul 2025 12:24:39 +0000 (14:24 +0200)
Add a copy of the text from SimpleQueue.close()

---------

Co-authored-by: saggarwal145 <saggarwal145@bloomberg.net>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Doc/library/multiprocessing.rst

index 546876bd925db0aa4e0c89b88a73ef4eaeb1c706..c80f78e614818ebf2acf52e42d5ccc407370a61b 100644 (file)
@@ -936,8 +936,13 @@ For an example of the usage of queues for interprocess communication see
 
    .. method:: close()
 
-      Indicate that no more data will be put on this queue by the current
-      process.  The background thread will quit once it has flushed all buffered
+      Close the queue: release internal resources.
+
+      A queue must not be used anymore after it is closed. For example,
+      :meth:`~Queue.get`, :meth:`~Queue.put` and :meth:`~Queue.empty`
+      methods must no longer be called.
+
+      The background thread will quit once it has flushed all buffered
       data to the pipe.  This is called automatically when the queue is garbage
       collected.