original_string: private function runExclusive($closure)
      {
          $process = new Process('archive.sharedsiteids');
  
          while ($process->isRunning() && $process->getSecondsSinceCreation() < 5) {
              // wait max 5 seconds, such an operation should not take longer
              usleep(25 * 1000);
          }
  
          $process->startProcess();
  
          try {
              $result = $closure();
          } catch (Exception $e) {
              $process->finishProcess();
              throw $e;
          }
  
          $process->finishProcess();
  
          return $result;
      }
code: private function runExclusive($closure)
      {
          $process = new Process('archive.sharedsiteids');
  
          while ($process->isRunning() && $process->getSecondsSinceCreation() < 5) {
              // wait max 5 seconds, such an operation should not take longer
              usleep(25 * 1000);
          }
  
          $process->startProcess();
  
          try {
              $result = $closure();
          } catch (Exception $e) {
              $process->finishProcess();
              throw $e;
          }
  
          $process->finishProcess();
  
          return $result;
      }
code_tokens: private function runExclusive ( $ closure ) { $ process = new Process ( 'archive.sharedsiteids' ) ; while ( $ process -> isRunning ( ) && $ process -> getSecondsSinceCreation ( ) < 5 ) { // wait max 5 seconds, such an operation should not take longer usleep ( 25 * 1000 ) ; } $ process -> startProcess ( ) ; try { $ result = $ closure ( ) ; } catch ( Exception $ e ) { $ process -> finishProcess ( ) ; throw $ e ; } $ process -> finishProcess ( ) ; return $ result ; }
docstring: If there are multiple archiver running on the same node it makes sure only one of them performs an action and it
  will wait until another one has finished. Any closure you pass here should be very fast as other processes wait
  for this closure to finish otherwise. Currently only used for making multiple archivers at the same time work.
  If a closure takes more than 5 seconds we assume it is dead and simply continue.
  
  @param \Closure $closure
  @return mixed
  @throws \Exception
docstring_tokens: If there are multiple archiver running on the same node it makes sure only one of them performs an action and it will wait until another one has finished . Any closure you pass here should be very fast as other processes wait for this closure to finish otherwise . Currently only used for making multiple archivers at the same time work . If a closure takes more than 5 seconds we assume it is dead and simply continue .