original_string: private function fork()
      {
          /** @var LoggerInterface $logger */
          $logger = $this->getContainer()->get('logger');
          if (!$this->getContainer()->get('tenside.config')->isForkingAvailable()) {
              $logger->warning('Forking disabled by configuration, execution will block until the command has finished.');
  
              return false;
          } elseif (!FunctionAvailabilityCheck::isFunctionEnabled('pcntl_fork', 'pcntl')) {
              $logger->warning('pcntl_fork() is not available, execution will block until the command has finished.');
  
              return false;
          } else {
              $pid = pcntl_fork();
              if (-1 === $pid) {
                  throw new \RuntimeException('pcntl_fork() returned -1.');
              } elseif (0 !== $pid) {
                  // Tell the calling method to exit now.
                  $logger->info('Forked process ' . posix_getpid() . ' to pid ' . $pid);
                  return true;
              }
  
              $logger->info('Processing task in forked process with pid ' . posix_getpid());
              return false;
          }
      }
code: private function fork()
      {
          /** @var LoggerInterface $logger */
          $logger = $this->getContainer()->get('logger');
          if (!$this->getContainer()->get('tenside.config')->isForkingAvailable()) {
              $logger->warning('Forking disabled by configuration, execution will block until the command has finished.');
  
              return false;
          } elseif (!FunctionAvailabilityCheck::isFunctionEnabled('pcntl_fork', 'pcntl')) {
              $logger->warning('pcntl_fork() is not available, execution will block until the command has finished.');
  
              return false;
          } else {
              $pid = pcntl_fork();
              if (-1 === $pid) {
                  throw new \RuntimeException('pcntl_fork() returned -1.');
              } elseif (0 !== $pid) {
                  // Tell the calling method to exit now.
                  $logger->info('Forked process ' . posix_getpid() . ' to pid ' . $pid);
                  return true;
              }
  
              $logger->info('Processing task in forked process with pid ' . posix_getpid());
              return false;
          }
      }
code_tokens: private function fork ( ) { /** @var LoggerInterface $logger */ $ logger = $ this -> getContainer ( ) -> get ( 'logger' ) ; if ( ! $ this -> getContainer ( ) -> get ( 'tenside.config' ) -> isForkingAvailable ( ) ) { $ logger -> warning ( 'Forking disabled by configuration, execution will block until the command has finished.' ) ; return false ; } elseif ( ! FunctionAvailabilityCheck :: isFunctionEnabled ( 'pcntl_fork' , 'pcntl' ) ) { $ logger -> warning ( 'pcntl_fork() is not available, execution will block until the command has finished.' ) ; return false ; } else { $ pid = pcntl_fork ( ) ; if ( - 1 === $ pid ) { throw new \ RuntimeException ( 'pcntl_fork() returned -1.' ) ; } elseif ( 0 !== $ pid ) { // Tell the calling method to exit now. $ logger -> info ( 'Forked process ' . posix_getpid ( ) . ' to pid ' . $ pid ) ; return true ; } $ logger -> info ( 'Processing task in forked process with pid ' . posix_getpid ( ) ) ; return false ; } }
docstring: Try to fork.
  
  The return value determines if the caller shall exit (when forking was successful and it is the forking process)
  or rather proceed execution (is the fork or unable to fork).
  
  True means exit, false means go on in this process.
  
  @return bool
  
  @throws \RuntimeException When the forking caused an error.
docstring_tokens: Try to fork .