<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _restart(self, submit=True):
 """ Called by restart once we have finished preparing the task for restarting. Return: True if task has been restarted """

        self.set_status(self.S_READY, msg="Restarted on %s" % time.asctime())

        # Increase the counter.
        self.num_restarts += 1
        self.history.info("Restarted, num_restarts %d" % self.num_restarts)

        # Reset datetimes
        self.datetimes.reset()

        # Remove the lock file
        self.start_lockfile.remove()

        if submit:
            # Relaunch the task.
            fired = self.start()
            if not fired: self.history.warning("Restart failed")
        else:
            fired = False

        return fired