Stops the hunt if number of crashes exceeds the limit.
496647
def StopHuntIfCrashLimitExceeded(hunt_id):
  """"""
  hunt_obj = data_store.REL_DB.ReadHuntObject(hunt_id)

  # Do nothing if the hunt is already stopped.
  if hunt_obj.hunt_state == rdf_hunt_objects.Hunt.HuntState.STOPPED:
    return hunt_obj

  if hunt_obj.crash_limit:
    hunt_counters = data_store.REL_DB.ReadHuntCounters(hunt_id)
    if hunt_counters.num_crashed_clients >= hunt_obj.crash_limit:
      # Remove our rules from the forman and cancel all the started flows.
      # Hunt will be hard-stopped and it will be impossible to restart it.
      reason = ("Hunt %s reached the crashes limit of %d "
                "and was stopped.") % (hunt_obj.hunt_id, hunt_obj.crash_limit)
      StopHunt(hunt_obj.hunt_id, reason=reason)

  return hunt_obj
876069
def stop(self):
        """"""

        if self._started is False:
            raise ArgumentError("EmulationLoop.stop() called without calling start()")

        self.verify_calling_thread(False, "Cannot call EmulationLoop.stop() from inside the event loop")

        if self._thread.is_alive():
            self._loop.call_soon_threadsafe(self._loop.create_task, self._clean_shutdown())
            self._thread.join()
260924
public void stopChecking() {
        // synchronize with other attempts to update the running task
        synchronized(runningTaskLock){
            if(runningTask != null) {
                // cancel task (let it complete its current run if running)
                runningTaskFuture.cancel(false);
                // log
                LOGGER.debug("Stop criterion checker for search {} deactivated", search);
                // discard task
                runningTask = null;
                runningTaskFuture = null;
            }
        }
    }
258346
def halt(self):
        
        if self._callback:
            self._thread_continue = False
            self._thread.join()
835111
def ProcessHuntClientCrash(flow_obj, client_crash_info):
  """"""

  if not hunt.IsLegacyHunt(flow_obj.parent_hunt_id):
    hunt.StopHuntIfCrashLimitExceeded(flow_obj.parent_hunt_id)
    return

  hunt_urn = rdfvalue.RDFURN("hunts").Add(flow_obj.parent_hunt_id)

  with aff4.FACTORY.Open(hunt_urn, mode="rw") as fd:
    # Legacy AFF4 code expects token to be set.
    fd.token = access_control.ACLToken(username=fd.creator)
    fd.RegisterCrash(client_crash_info)
24784
public void stop() {

    reflector.stop();
    reflectorFuture.cancel(true);
    reflectExecutor.shutdown();

    if (resyncFuture != null) {
      resyncFuture.cancel(true);
      resyncExecutor.shutdown();
    }
  }
752804
public void stop()
    {
        synchronized (mAnimQueue)
        {
            if (mIsRunning && (mAnimQueue.size() > 0))
            {
                mIsRunning = false;
                GVRAnimator animator = mAnimQueue.get(0);
                mAnimQueue.clear();
                animator.stop();
            }
        }
    }
118235
public void stop() {
        if (mMonitorStarted) {
            mMonitorStarted = false;
            Looper.getMainLooper().setMessageLogging(null);
            mBlockCanaryCore.stackSampler.stop();
            mBlockCanaryCore.cpuSampler.stop();
        }
    }
1286223
public Retryer<R> stopAfterAttempt(final int maxAttemptNumber) {
        checkArgument(maxAttemptNumber >= 1, "maxAttemptNumber must be >= 1 but is %d", maxAttemptNumber);
        return withStopStrategy(new StopStrategy() {
            
            @Override public boolean shouldStop(int previousAttemptNumber, long delaySinceFirstAttemptInMillis) {
                return previousAttemptNumber >= maxAttemptNumber;
            }
        });
    }
861101
def must_stop(self):
        
        return bool(self.terminate_gracefuly and self.end_signal_caught
                 or self.num_loops >= self.max_loops or self.end_forced
                 or self.wanted_end_date and datetime.utcnow() >= self.wanted_end_date)
829056
@Stop(priority = 9999)
   public void stop() {
      for (int i = 0; i < maps.length(); ++i) {
         stopMap(i, false);
      }
   }
1056712
def stop(self):
        
        self._stopped = True
        for result in self._results:
            result._set_result(Failure(ReactorStopped()))
137876
private void stop() {
		for (int i = 0; i < mDownloadDispatchers.length; i++) {
			if (mDownloadDispatchers[i] != null) {
				mDownloadDispatchers[i].quit();
			}
		}
	}
334018
def stop(self):
        """"""

        self._target = self.position

        self.log.info('Stopping movement after user request.')

        return self.target, self.position
277368
private static void stopAllocCounting() {
        Runtime.getRuntime().gc();
        Runtime.getRuntime().runFinalization();
        Runtime.getRuntime().gc();
        Debug.stopAllocCounting();
    }
1158042
public void stop() {
		hits = 0;
		misses = 0;
		unavailable = 0;
		delayedHits = 0;
		delayedMisses = 0;
		data.clear();
		mirror.clear();
		isStarted = false;
	}
304144
public function stopNow()
    {
        $this->run = false;
        $this->boss->stopEmployees();
        $this->boss->updateProgress();
    }