mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Fix bpo-30596: Add close() method to multiprocessing.Process (#2010)
* Fix bpo-30596: Add close() method to multiprocessing.Process * Raise ValueError if close() is called before the Process is finished running * Add docs * Add NEWS blurb
This commit is contained in:
parent
0ee32c1481
commit
13e96cc596
9 changed files with 106 additions and 8 deletions
|
@ -598,6 +598,16 @@ The :mod:`multiprocessing` package mostly replicates the API of the
|
|||
acquired a lock or semaphore etc. then terminating it is liable to
|
||||
cause other processes to deadlock.
|
||||
|
||||
.. method:: close()
|
||||
|
||||
Close the :class:`Process` object, releasing all resources associated
|
||||
with it. :exc:`ValueError` is raised if the underlying process
|
||||
is still running. Once :meth:`close` returns successfully, most
|
||||
other methods and attributes of the :class:`Process` object will
|
||||
raise :exc:`ValueError`.
|
||||
|
||||
.. versionadded:: 3.7
|
||||
|
||||
Note that the :meth:`start`, :meth:`join`, :meth:`is_alive`,
|
||||
:meth:`terminate` and :attr:`exitcode` methods should only be called by
|
||||
the process that created the process object.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue