Called when the signal is caught
@param integer Signal's number
@return void
971948
public function sighandler($signo)
    {
        if (!isset(self::$signals[$signo])) {
            $this->log('caught unknown signal #' . $signo);
            return;
        }
        if (method_exists($this, $m = strtolower(self::$signals[$signo]))) {
            $this->$m();
        } elseif (method_exists($this, 'sigunknown')) {
            $this->sigunknown($signo);
        }
    }
920459
protected function stop_children($signal=SIGTERM) {
        $this->log("Stopping children", GearmanManager::LOG_LEVEL_PROC_INFO);

        foreach ($this->children as $pid=>$child) {
            $this->log("Stopping child $pid (".implode(",", $child['job']).")", GearmanManager::LOG_LEVEL_PROC_INFO);
            posix_kill($pid, $signal);
        }

    }
772204
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\LocationService\UnhideLocationSignal) {
            return;
        }

        $this->indexSubtree($signal->locationId);
    }
403532
public function signalHandler()
    {
        if (!$this->_working) {
            $this->log('Not doing any jobs, going to die now...', 'warning');
            $this->_stop();
            return;
        }

        $this->stop = true;
    }
552268
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\ObjectStateService\DeleteObjectStateSignal) {
            return;
        }

        parent::receive($signal);
    }
464380
public function signalReceived($signal): void
    {
        $form = $this->getForm();
        /** @var Presenter $presenter */
        $presenter = $this->getPresenter();
        $request = $presenter->getRequest();

        switch ($signal) {
            case 'submit':
                $this->processSubmit($form, $request);
                break;
            case 'validate':
                $this->processValidate($form, $request);
                break;
            case 'render':
                $this->processRender($form, $request);
                break;
            default:
                throw new BadSignalException(
                    sprintf('Missing handler for signal "%s" in %s.', $signal, get_class($this))
                );
        }
    }
245402
public void signal(boolean signal_all) {
        lock.lock();
        try {
            if(signal_all)
                cond.signalAll();
            else
                cond.signal();
        }
        finally {
            lock.unlock();
        }
    }
893879
protected function _trapSignals() {
		$this->_log->debug('Trapping signals.');

		$handler = function($number) {
			switch ($number) {
				case SIGQUIT:
					$this->_log->debug('Received SIGQUIT, waiting and exiting.');

					$this->_break = true;
					$this->_connection->disconnect();
					exit(0);
				case SIGINT:
				case SIGTERM:
					$this->_log->debug('Received SIGTERM/SIGINT, killing exiting.');
					$this->_connection->disconnect();
					exit(1);
				case SIGUSR2:
					$this->_log->debug('Received SIGUSR2, pausing job processing.');

					$this->_paused = true;
					$this->_interval = 10;
					break;
				case SIGCONT:
					$this->_log->debug('Received SIGCONT, continuing to process jobs.');

					$this->_paused = false;
					$this->_interval = null;
					break;
			}
		};
		pcntl_signal(SIGQUIT, $handler);
		pcntl_signal(SIGINT,  $handler);
		pcntl_signal(SIGTERM, $handler);
		pcntl_signal(SIGUSR2, $handler);
		pcntl_signal(SIGCONT, $handler);
	}
955592
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\LocationService\DeleteLocationSignal) {
            return;
        }

        $this->runLegacyKernelCallback(
            static function () use ($signal) {
                // First clear object memory cache to prevent false detection of possibly deleted Content
                eZContentObject::clearCache($signal->contentId);

                if (eZContentObject::exists($signal->contentId)) {
                    // If Content still exists reindex is needed
                    eZContentOperationCollection::registerSearchObject($signal->contentId);
                } else {
                    // Else Content was deleted with the last Location, so we remove it from the index
                    eZSearch::removeObjectById($signal->contentId);
                }

                eZContentCacheManager::clearContentCacheIfNeeded($signal->contentId, true, [$signal->locationId]);
                eZSearch::removeNodes([$signal->locationId]);
                eZContentObject::clearCache(); // Clear all object memory cache to free memory
            }
        );
    }
1204842
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\ObjectStateService\SetContentStateSignal) {
            return;
        }

        $this->runLegacyKernelCallback(
            static function () use ($signal) {
                eZContentCacheManager::clearContentCacheIfNeeded($signal->contentId);
                eZSearch::updateObjectState($signal->contentId, [$signal->objectStateId]);
                eZContentObject::clearCache(); // Clear all object memory cache to free memory
            }
        );
    }
262238
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\LocationService\CreateLocationSignal) {
            return;
        }

        $this->client->updateContent($signal->contentId);
    }
1104614
def _handle_signals(self):
        
        signal.signal(signal.SIGTERM, signal.SIG_DFL)
        signal.signal(signal.SIGINT, signal.SIG_IGN)
162089
public function stop( $_signal = SIGKILL, $_wait = false ) {
		if( $this->isAlive() ) {
			posix_kill( $this->pid, $_signal );
			if( $_wait ) {
				pcntl_waitpid( $this->pid, $status = 0 );
			}
		}
	}
1314302
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\UserService\CreateUserSignal) {
            return;
        }

        $userContentInfo = $this->persistenceHandler->contentHandler()->loadContentInfo(
            $signal->userId
        );

        $this->searchHandler->indexContent(
            $this->persistenceHandler->contentHandler()->load(
                $userContentInfo->id,
                $userContentInfo->currentVersionNo
            )
        );

        $locations = $this->persistenceHandler->locationHandler()->loadLocationsByContent(
            $userContentInfo->id
        );
        foreach ($locations as $location) {
            $this->searchHandler->indexLocation($location);
        }
    }
649774
def _signal_handler(self, *_) -> None:
        
        if self._num_signals == 0:
            logging.warning('Interrupt signal caught - training will be terminated')
            logging.warning('Another interrupt signal will terminate the program immediately')
            self._num_signals += 1
        else:
            logging.error('Another interrupt signal caught - terminating program immediately')
            sys.exit(2)
1325163
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\UserService\CreateUserGroupSignal) {
            return;
        }

        $userGroupContentInfo = $this->persistenceHandler->contentHandler()->loadContentInfo(
            $signal->userGroupId
        );

        $this->searchHandler->indexContent(
            $this->persistenceHandler->contentHandler()->load(
                $userGroupContentInfo->id,
                $userGroupContentInfo->currentVersionNo
            )
        );

        $locations = $this->persistenceHandler->locationHandler()->loadLocationsByContent(
            $userGroupContentInfo->id
        );
        foreach ($locations as $location) {
            $this->searchHandler->indexLocation($location);
        }
    }
232673
public function receive(Signal $signal)
    {
        if (!$signal instanceof Signal\LocationService\CreateLocationSignal) {
            return;
        }

        $this->runLegacyKernelCallback(
            static function () use ($signal) {
                eZContentCacheManager::clearContentCacheIfNeeded($signal->contentId, true, [$signal->locationId]);
                $object = eZContentObject::fetch($signal->contentId);
                eZSearch::addNodeAssignment($object->mainNodeID(), $signal->contentId, $signal->locationId);
                eZContentObject::clearCache(); // Clear all object memory cache to free memory
            }
        );
    }