gh-131913: multiprocessing: add interrupt for POSIX (GH-132453)

* multiprocessing: interrupt

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This commit is contained in:
pulkin 2025-04-23 08:55:24 +02:00 committed by GitHub
parent 862fd89036
commit 77605fa3bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 54 additions and 2 deletions

View file

@ -125,6 +125,13 @@ class BaseProcess(object):
del self._target, self._args, self._kwargs
_children.add(self)
def interrupt(self):
'''
Terminate process; sends SIGINT signal
'''
self._check_closed()
self._popen.interrupt()
def terminate(self):
'''
Terminate process; sends SIGTERM signal or uses TerminateProcess()