def METHOD_NAME(self):
    with self.lock:
        if not self.process:
            return
        self.task_queue.put(None)
        self.result_queue.put(None)
        process = self.process
        self.process = None
        self.task_queue = None
        self.result_queue = None
    process.join(timeout=0.1)
    if process.exitcode is None:
        os.kill(process.pid, signal.SIGKILL)
        process.join()