Called by an entity that would like to prevent a reboot.
357498
public int preventReboot (String whereFrom)
    {
        if (whereFrom == null) {
            throw new IllegalArgumentException("whereFrom must be descriptive.");
        }
        int lockId = _nextRebootLockId++;
        _rebootLocks.put(lockId, whereFrom);
        return lockId;
    }
587394
def reboot(vm_):
    '''
    
    '''
    with _get_xapi_session() as xapi:
        vm_uuid = _get_label_uuid(xapi, 'VM', vm_)
        if vm_uuid is False:
            return False
        try:
            xapi.VM.clean_reboot(vm_uuid)
            return True
        except Exception:
            return False
208553
def _retry(self, state):
        '''
        
        '''
        state.attempt += 1
        self.debug('Starting restart attempt: %d.', state.attempt)
        if self._cmp_strategy(RestartStrategy.buryme):
            self.debug('Agent %r is going to by buried according to his '
                       'last will.', state.factory.descriptor_type)
            return self._send_buried_notifications()
        else:
            f = self._set_restart_flag()
            f.add_callback(fiber.drop_param, self._send_died_notifications)
            f.add_both(self._ensure_someone_took_responsability)
            return f
171870
def cancel(self) :
        ""
        dbus.dbus_pending_call_cancel(self._dbobj)
        if self._awaiting != None :
            # This probably shouldn’t occur. Looking at the source of libdbus,
            # it doesn’t keep track of any “cancelled” state for the PendingCall,
            # it just detaches it from any notifications about an incoming reply.
            self._awaiting.cancel()
706439
public synchronized void interruptLeadership()
    {
        Future<?> task = ourTask.get();
        if ( task != null )
        {
            task.cancel(true);
        }
    }
692717
public void stop() {
      // This method might get called several times.
      if (stopped) return;
      if (needToUnregister) {
         try {
            unregisterMBeans(resourceDMBeans);
            needToUnregister = false;
         } catch (Exception e) {
            log.problemsUnregisteringMBeans(e);
         }
      }
      stopped = true;
   }
584141
def guest_reboot(self, userid):
        """"""
        LOG.info("Begin to reboot vm %s", userid)
        self._smtclient.guest_reboot(userid)
        LOG.info("Complete reboot vm %s", userid)
1089258
def stop(self):
        """"""

        for tile in self._tiles.values():
            tile.signal_stop()

        for tile in self._tiles.values():
            tile.wait_stopped()

        super(TileBasedVirtualDevice, self).stop()
703702
public void removeEntity(Entity entity){
		boolean delayed = updating || familyManager.notifying();
		entityManager.removeEntity(entity, delayed);
	}
691577
def reboot(name, call=None):
    '''
    
    '''
    if call != 'action':
        raise SaltCloudSystemExit(
            'The restart action must be called with -a or --action.'
        )

    data = show_instance(name, call='action')
    if data.get('status') == 'off':
        return {'success': True,
                'action': 'stop',
                'status': 'off',
                'msg': 'Machine is already off.'}

    ret = query(droplet_id=data['id'],
                command='actions',
                args={'type': 'reboot'},
                http_method='post')

    return {'success': True,
            'action': ret['action']['type'],
            'state': ret['action']['status']}
481769
private void resetAlarmDueTimesOnReboot() {
        // As the device has been rebooted, we use clock time rather than elapsed time since
        // booting to set check whether we missed any alarms while the device was off and to
        // make sure the next alarm time isn't too far in the future (indicating the system clock
        // has been reset).
        //
        // We subtract the current time from the next expected alarm time and then do the
        // following checks:
        // * If it's less than zero, that means we missed an alarm when the device was off, so
        //   we schedule a replication immediately by setting the last alarm time to a time
        //   getIntervalInSeconds() ago.
        // * If it's more than getIntervalInSeconds() in the future, that means the system clock
        //   has been reset since the last alarm was fired.  Therefore, we check that the initial
        //   interval for the alarm is no later than getIntervalInSeconds() after the
        //   current time so we minimise the impact of the system clock being reset and will at most
        //   have to wait for the normal interval time.
        // * Otherwise, the clock time for the alarm seems reasonable, but we still need to update
        //   the SharedPreference for the elapsed time since boot at which the last alarm would have
        //   fired as that currently refers to the time since boot from the previous boot of the
        //   device.
        //
        // We don't actually setup the AlarmManager here as it is up to the subclass to determine
        // if all other conditions for the replication policy are met and determine whether to
        // restart replications after a reboot.
        setPeriodicReplicationEnabled(false);
        long initialInterval = getNextAlarmDueClockTime() - System.currentTimeMillis();
        if (initialInterval < 0) {
            setLastAlarmTime(getIntervalInSeconds() * MILLISECONDS_IN_SECOND);
        } else if (initialInterval > getIntervalInSeconds() * MILLISECONDS_IN_SECOND) {
            setLastAlarmTime(0);
        } else {
            setLastAlarmTime((getIntervalInSeconds() * MILLISECONDS_IN_SECOND) - initialInterval);
        }
    }
516776
def reboot(vm_name, call=None):
    '''
    
    '''
    if call != 'action':
        raise SaltCloudSystemExit(
            'The reboot action must be called with -a or --action.'
        )

    conn = get_conn()

    __utils__['cloud.fire_event'](
        'event',
        'reboot instance',
        'salt/cloud/{0}/rebooting'.format(vm_name),
        args={'name': vm_name},
        sock_dir=__opts__['sock_dir'],
        transport=__opts__['transport']
    )

    result = conn.reboot_node(
        conn.ex_get_node(vm_name)
    )

    __utils__['cloud.fire_event'](
        'event',
        'reboot instance',
        'salt/cloud/{0}/rebooted'.format(vm_name),
        args={'name': vm_name},
        sock_dir=__opts__['sock_dir'],
        transport=__opts__['transport']
    )

    return result
1263514
public static br_broker force_reboot(nitro_service client, br_broker resource) throws Exception
	{
		return ((br_broker[]) resource.perform_operation(client, "force_reboot"))[0];
	}
1181306
public static function reboot()
    {
        //====================================================================//
        // Clear Module Configuration Array
        if (isset(self::core()->conf)) {
            self::core()->conf = null;
        }
        //====================================================================//
        // Clear Webservice Configuration
        if (isset(self::core()->soap)) {
            self::core()->soap = null;
        }
        //====================================================================//
        // Clear Module Local Objects Classes
        if (isset(self::core()->objects)) {
            self::core()->objects = null;
        }
        //====================================================================//
        // Clear Module Log
        self::log()->cleanLog();
        self::log()->deb('Splash Module Rebooted');
    }
659715
async def stop(self) -> None:
        """"""
        if not self._is_running:
            raise SublemonRuntimeError(
                'Attempted to stop an already-stopped `Sublemon` instance')

        await self.block()
        self._poll_task.cancel()
        self._is_running = False
        with suppress(asyncio.CancelledError):
            await self._poll_task
818048
function restartRelay(cb) {
        var self = this;
        this.stop(function (err) {
            if (err) {
                return cb(err);
            }
            self.start(cb);
        });
    }
266149
public static ns force_reboot(nitro_service client, ns resource) throws Exception
	{
		return ((ns[]) resource.perform_operation(client, "force_reboot"))[0];
	}