Pause if necessary

@return void
979859
protected function checkPause()
    {
        $this->paused = false;

        if ($this->options['pause_always']) {
            usleep($this->options['pause_always']);
            $this->paused = true;
        }
    }
239571
def pause(self):
        """"""
        yield from self.manager.query("POST", "containers/{}/pause".format(self._cid))
        self.status = "suspended"
        log.info("Docker container '{name}' [{image}] paused".format(name=self._name, image=self._image))
775754
public function stop()
    {
        if (null === $this->sectionName) {
            throw new \LogicException('You must start a section before you can stop it.');
        }

        if (!isset($this->sections[$this->sectionName])) {
            $this->sections[$this->sectionName] = '';
        }

        $this->sections[$this->sectionName] = $this->appendSection ? $this->sections[$this->sectionName] . ob_get_clean() : ob_get_clean();
        $this->sectionName = null;
        $this->appendSection = false;
    }
1018661
public function stop()
    {
        if ($this->stopTimer) {
            $this->eventLoop->cancelTimer($this->stopTimer);
            $this->stopTimer = null;
        }

        $this->eventLoop->stop();
    }
205865
public function stop()
    {
        foreach (array_reverse($this->getArrayCopy()) as $playback) {
            /* @var $playback Playback */
            try {
                $this->phparia->playbacks()->stopPlayback($playback->getId());
            } catch (\Exception $ignore) {
                // Don't throw exception if the playback does not exist
            }
        }
    }
445813
public function stop() {
		global $wpdb, $wp_object_cache;

		if ( ! is_null( $this->start_time ) ) {
			$this->time += microtime( true ) - $this->start_time;
		}
		if ( ! is_null( $this->query_offset ) && isset( $wpdb ) && ! empty( $wpdb->queries ) ) {
			for ( $i = $this->query_offset; $i < count( $wpdb->queries ); $i++ ) {
				$this->query_time += $wpdb->queries[ $i ][1];
				$this->query_count++;
			}
		}

		if ( ! is_null( $this->cache_hit_offset ) && ! is_null( $this->cache_miss_offset ) && isset( $wp_object_cache ) ) {
			$cache_hits         = ! empty( $wp_object_cache->cache_hits ) ? $wp_object_cache->cache_hits : 0;
			$cache_misses       = ! empty( $wp_object_cache->cache_misses ) ? $wp_object_cache->cache_misses : 0;
			$this->cache_hits   = $cache_hits - $this->cache_hit_offset;
			$this->cache_misses = $cache_misses - $this->cache_miss_offset;
			$cache_total        = $this->cache_hits + $this->cache_misses;
			if ( $cache_total ) {
				$ratio             = ( $this->cache_hits / $cache_total ) * 100;
				$this->cache_ratio = round( $ratio, 2 ) . '%';
			}
		}

		$this->start_time        = null;
		$this->query_offset      = null;
		$this->cache_hit_offset  = null;
		$this->cache_miss_offset = null;
		if ( false !== ( $key = array_search( $this, self::$active_loggers ) ) ) {
			unset( self::$active_loggers[ $key ] );
		}
	}
120441
function() {
        sound._paused = false;
        sound._seek = seek;
        sound._start = start;
        sound._stop = stop;
        sound._loop = loop;
      }
877421
public function pauseRecv()
    {
        Worker::$globalEvent->del($this->_socket, EventInterface::EV_READ);
        $this->_isPaused = true;
    }
424441
def pause(expected = nil)
      paused = listener.paused?
      states = { paused: true, unpaused: false, toggle: !paused }
      pause = states[expected || :toggle]
      fail ArgumentError, "invalid mode: #{expected.inspect}" if pause.nil?
      return if pause == paused

      listener.public_send(pause ? :pause : :start)
      UI.info "File event handling has been #{pause ? 'paused' : 'resumed'}"
    end
177458
def pause(self):
        
        for child in chain(self.consumers.values(), self.workers):
            child.pause()

        for child in chain(self.consumers.values(), self.workers):
            child.paused_event.wait()
25305
public function resume()
    {
        $this->paused = false;

        if($this->getProcess()->getPid() == getmypid()) {
            $this->getLogger()->notice('SIGCONT received; resuming job processing');
        }else{
            $this->getProcess()->kill(SIGCONT);
        }
    }
601141
public function pauseQueue()
    {
        $url = $this->buildUrl('set_pause');
        $request = $this->guzzle->request('GET', $url);

        return json_decode($request->getBody(), true)['status'];
    }
583453
function pause () {
        triggerEvent('pause');
        stopLoop(animationId);
        pausedAfter = startTime - performance.now();
        startTime = undefined;
        return self;
      }
912517
public function stop()
  {
    if(!$this->isRunning()) return;

    $this->data["runtime"] += microtime(TRUE) - $this->started;
    $this->data["realmem"] += memory_get_usage(TRUE) - $this->data["realmem_start"];
    $this->data["emalloc"] += memory_get_usage() - $this->data["emalloc_start"];

    $this->started = 0;
    $this->running = FALSE;
  }
292513
public function stop()
    {
        $this->oxactions__oxactiveto = new \OxidEsales\Eshop\Core\Field(date('Y-m-d H:i:s', \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime()));
        $this->save();
    }
503171
def pause(self):
        """"""
        res = librtmp.RTMP_Pause(self.client.rtmp, 1)

        if res < 1:
            raise RTMPError("Failed to pause")
487783
def pause(self):
        """"""
        if self.state == PygAnimation.PLAYING:
            self.elapsedAtPause = self.elapsed
            # only change state if it was playing
            self.state = PygAnimation.PAUSED

        elif self.state == PygAnimation.STOPPED:
            pass  # nothing to do

        elif self.state == PygAnimation.PAUSED:
            pass