]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-135730: Clarify multiprocessing.Queue close() documentation (GH-136803...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 19 Jul 2025 12:58:08 +0000 (14:58 +0200)
committerGitHub <noreply@github.com>
Sat, 19 Jul 2025 12:58:08 +0000 (14:58 +0200)
gh-135730: Clarify multiprocessing.Queue close() documentation (GH-136803)

Add a copy of the text from SimpleQueue.close()

---------
(cherry picked from commit f575588ccf27d8d54a1e99cfda944f2614b3255c)

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

index 529cd5ce03c8c47c908ca3980cef856bd5c22c2d..92d6bf9a07a30e16ad3e11277c8ebba8fc98dfb4 100644 (file)
@@ -897,8 +897,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.