def METHOD_NAME(self, worker_id, stashes):
    if self._worker_exit_args_lock is not None:
        # callback is enabled
        # we add this check since passing Python objects between processes is definitely not fast
        with self._worker_exit_args_lock:
            self._worker_exit_args[worker_id] = (
                worker_id,
                stashes,
            )