Called by restart once we have finished preparing the task for restarting.

        Return:
            True if task has been restarted
509806
def _restart(self, submit=True):
        
        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
1241341
def thread_stopped(self):
		
		task = self.task()
		if isinstance(task, WStoppableTask) is True:
			task.stop()
543362
def thread_stopped(self):
		
		if self.__current_task is not None:
			task = self.__task_chain[self.__current_task]
			task.stop()
			self.__current_task = None
293803
def done(self):
        """"""
        if self._finished or self._unfinished:
            return False
        # Clear the 'current' values when iteration is done.
        self.current_index = self.current_future = None
        return True
1222915
def restart(self, timeout=None, task=None, block_callbacks=False, role=None):
        
        self.set_state('restarting')
        if not block_callbacks:
            self.__cb_pending = ACTION_ON_RESTART
        ret = self.stop(block_callbacks=True) and self.start(timeout, task, True, role)
        if not ret and not self.is_starting():
            self.set_state('restart failed ({0})'.format(self.state))
        return ret
1126927
def has_reset(self):
        """"""
        currentTime = self._read_as_int(Addr.Uptime, 4)
        if currentTime <= self._ticks:
            self._ticks = currentTime
            return True
        self._ticks = currentTime
        return False
26807
def reset(self):
        
        if self._status is not TaskStatus.STOPPED:
            raise RuntimeError("Cannot reset %s in state %s" %
                               (self, self._status))
        self._reset()
        self.return_values = {}
        self._status = TaskStatus.IDLE
7449
def finished_or_stopped(self):
        
        return (self._status.execution_mode is StateMachineExecutionStatus.STOPPED) or \
               (self._status.execution_mode is StateMachineExecutionStatus.FINISHED)
1111586
def is_running(self):
        
        state = yield from self._get_container_state()
        if state == "running":
            return True
        if self.status == "started":  # The container crashed we need to clean
            yield from self.stop()
        return False
564937
def restart(self):
        
        if self.verbose:
            print("Restarting {} {} ...".format(sys.executable, sys.argv))
        os.execl(sys.executable, *([sys.executable] + sys.argv))
1132200
def finished(self):
    

    return self.__state in (Job.ERROR, Job.SUCCESS, Job.CANCELLED)
775065
synchronized void restart()
    {
        TransactionTask task = m_backlog.getFirst();
        if (task.needCoordination() && m_scoreboardEnabled) {
            coordinatedTaskQueueOffer(task);
        } else {
            taskQueueOffer(task);
        }
    }
1329137
def check(self):
		
		if self.__next_start is not None:
			utc_now = utc_datetime()
			if utc_now >= self.__next_start:
				result = []

				for task_source in self.__next_sources:
					records = task_source.has_records()
					if records is not None:
						result.extend(records)

				self.__update_all()

				if len(result) > 0:
					return tuple(result)
255282
def check_complete(self):
        
        logger.debug('Running check_complete for task {0}'.format(self.name))

        # Tasks not completed
        if self.remote_not_complete() or self.local_not_complete():
            self._start_check_timer()
            return

        return_code = self.completed_task()

        # Handle task errors
        if self.terminate_sent:
            self.stderr += '\nDAGOBAH SENT SIGTERM TO THIS PROCESS\n'
        if self.kill_sent:
            self.stderr += '\nDAGOBAH SENT SIGKILL TO THIS PROCESS\n'
        if self.remote_failure:
            return_code = -1
            self.stderr += '\nAn error occurred with the remote machine.\n'

        self.stdout_file = None
        self.stderr_file = None

        self._task_complete(success=True if return_code == 0 else False,
                            return_code=return_code,
                            stdout=self.stdout,
                            stderr=self.stderr,
                            start_time=self.started_at,
                            complete_time=datetime.utcnow())
523577
def restart_pending?
      return false unless File.exist?(restart_file)
      request_time = File.mtime(restart_file)
      request_time > Incline.start_time
    end
285480
def check_status(self):
        """"""
        # Recompute the status of the tasks
        # Ignore OK and LOCKED tasks.
        for task in self:
            if task.status in (task.S_OK, task.S_LOCKED): continue
            task.check_status()

        # Take into account possible dependencies. Use a list instead of generators
        for task in self:
            if task.status == task.S_LOCKED: continue
            if task.status < task.S_SUB and all(status == task.S_OK for status in task.deps_status):
                task.set_status(task.S_READY, "Status set to Ready")
294902
def __thread_started(self):
		
		if self.__task is None:
			raise RuntimeError('Unable to start thread without "start" method call')
		self.__task.start()
		self.__task.start_event().wait(self.__scheduled_task_startup_timeout__)