Suspend the current task, changing the status to the given argument
327292
def suspend(status)
      raise "Cannot suspend while in exclusive mode" if exclusive?
      raise "Cannot suspend a task from outside of itself" unless Task.current == self

      @status = status

      # !!! DO NOT INTRODUCE ADDITIONAL GLOBAL VARIABLES !!!
      # rubocop:disable Style/GlobalVars
      if $CELLULOID_DEBUG && @dangerous_suspend
        Internals::Logger.with_backtrace(caller[2...8]) do |logger|
          logger.warn "Dangerously suspending task: type=#{@type.inspect}, meta=#{@meta.inspect}, status=#{@status.inspect}"
        end
      end
      # rubocop:enable Style/GlobalVars

      value = signal

      @status = :running
      raise value if value.is_a?(Celluloid::Interruption)
      value
    end
360100
def set_status(self, status):
        
        self.status = status
        for callback in self._update_status_callbacks:
            callback(self)
477731
def current_task(self, args):
        
        ctask = self.nice_name if self.nice_name is not None else self.name
        if args is not None:
            if args.update:
                ctask = ctask.replace('%pre', 'Updating')
            else:
                ctask = ctask.replace('%pre', 'Loading')
        return ctask
306177
private void updateState(final TaskStatus.State state) {
    statusUpdater.setState(state);
    // Commit and push a new status
    try {
      statusUpdater.update();
    } catch (InterruptedException e) {
      // TODO: propagate interrupt instead?
      Thread.currentThread().interrupt();
    }
  }
915059
def suspend
      _suspend(false) do
        system("tput cup 26 0")
        system("tput ed")
        system("echo Enter C-d to return to application")
        system (ENV['PS1']='\s-\v\$ ') if ENV['SHELL']== '/bin/bash'
        system(ENV['SHELL']);
      end
    end
1134916
def set_status(self, status):
        
        if status is not self.status:
            logger.debug("Setting %s state to %s.", self.stack.name,
                         status.name)
            self.status = status
            self.last_updated = time.time()
            if self.stack.logging:
                log_step(self)
192440
def task_stop(self, **kw):
        

        id, task = self.get_task(**kw)

        self._execute(id, 'stop')
        return self.get_task(uuid=task['uuid'])[1]
1203744
def set_status(self, status, origin=None, force=False):
        

        if not self.slave and origin not in self.program_stack:
            raise ValueError('Status cannot be changed directly')

        with self._actuator_status_lock:
            self.logger.debug("set_status got through, program: %s", origin)
            self.logger.debug("Set_status %s %s %s", self.name, origin, status)

            if self.slave:
                return self._do_change_status(status, force)

            self.logger.debug("Sets status %s for %s", status, origin.name)

            with self._program_lock:
                self.program_status[origin] = status

                if self.program == origin:
                    return self._do_change_status(status, force)
49784
def do_status(self, args):
        ''''''
        work_spec_name = self._get_work_spec_name(args)
        status = self.task_master.status(work_spec_name)
        self.stdout.write(json.dumps(status, indent=4, sort_keys=True) +
                          '\n')
419781
def set_timeout(self, delay, err=TimeoutError):
        """"""
        if _debug: IOCB._debug("set_timeout(%d) %r err=%r", self.ioID, delay, err)

        # if one has already been created, cancel it
        if self.ioTimeout:
            self.ioTimeout.suspend_task()
        else:
            self.ioTimeout = FunctionTask(self.abort, err)

        # (re)schedule it
        self.ioTimeout.install_task(delay=delay)
960480
def suspend(self):
        

        if self.manager.host_type != "ws":
            raise VMwareError("Pausing a VM is only supported by VMware Workstation")
        yield from self._control_vm("pause")
        self.status = "suspended"
        log.info("VMware VM '{name}' [{id}] paused".format(name=self.name, id=self.id))
679433
def _suspend(self):
        
        engine = self.current_engine()
        if "vm" in self._controller.computes:
            yield from self._controller.delete_compute("vm")
        if engine.running:
            log.info("")
            yield from engine.suspend()
767389
def halt(status=nil, body=nil)
      unless status.nil? || Integer === status
        body = status
        status = nil
      end
      response.status = status if status
      response.body = body if body
      throw :halt
    end
1133722
def stop(self):
        
        if self._status is TaskStatus.STOPPED:
            return

        if self._status is not TaskStatus.STARTED:
            raise RuntimeError("Cannot stop %s in state %s" %
                               (self, self._status))
        self._stop()

        STARTED_TASKS.remove(self)
        self._status = TaskStatus.STOPPED
340208
def do_cancel(self, taskid: int) -> None:
        """"""
        task = task_by_id(taskid, self._loop)
        if task:
            fut = asyncio.run_coroutine_threadsafe(
                cancel_task(task), loop=self._loop)
            fut.result(timeout=3)
            self._sout.write('Cancel task %d\n' % taskid)
        else:
            self._sout.write('No task %d\n' % taskid)
816978
def do_mode(self, args):
        ''''''
        if args.mode:
            mode = { 'idle': self.task_master.IDLE,
                     'run': self.task_master.RUN,
                     'terminate': self.task_master.TERMINATE }[args.mode]
            self.task_master.set_mode(mode)
            self.stdout.write('set mode to {0!r}\n'.format(args.mode))
        else:
            mode = self.task_master.get_mode()
            self.stdout.write('{0!s}\n'.format(mode))
334074
def pause():
	""""""

	if not settings.platformCompatible():
		return False

	(output, error) = subprocess.Popen(["osascript", "-e", PAUSE], stdout=subprocess.PIPE).communicate()