original_string: public static function term($pid, $lagger_timeout = 0, $signal = SIGTERM) {
  
          $kill_time = time() + $lagger_timeout;
  
          // $term = posix_kill($pid, $signal);
          $term = self::signal($pid, $signal);
  
          while ( time() < $kill_time ) {
  
              if ( !self::isRunning($pid) ) return $term;
              usleep(20000);
  
          }
  
          return self::kill($pid);
  
      }
code: public static function term($pid, $lagger_timeout = 0, $signal = SIGTERM) {
  
          $kill_time = time() + $lagger_timeout;
  
          // $term = posix_kill($pid, $signal);
          $term = self::signal($pid, $signal);
  
          while ( time() < $kill_time ) {
  
              if ( !self::isRunning($pid) ) return $term;
              usleep(20000);
  
          }
  
          return self::kill($pid);
  
      }
code_tokens: public static function term ( $ pid , $ lagger_timeout = 0 , $ signal = SIGTERM ) { $ kill_time = time ( ) + $ lagger_timeout ; // $term = posix_kill($pid, $signal); $ term = self :: signal ( $ pid , $ signal ) ; while ( time ( ) < $ kill_time ) { if ( ! self :: isRunning ( $ pid ) ) return $ term ; usleep ( 20000 ) ; } return self :: kill ( $ pid ) ; }
docstring: Terminate a process, asking PID to terminate or killing it directly.
  
  @param int $pid
  @param int $lagger_timeout Timeout to wait before killing process if it refuses to terminate
  @param int $signal Signal to send (default to SIGTERM)
  
  @return  bool
docstring_tokens: Terminate a process asking PID to terminate or killing it directly .