コード例 #1
0
ファイル: Thread.php プロジェクト: icicleio/concurrent
 /**
  * Closes channel and socket if still open.
  */
 private function close()
 {
     if (null !== $this->pipe && $this->pipe->isOpen()) {
         $this->pipe->close();
     }
     if (is_resource($this->socket)) {
         fclose($this->socket);
     }
     $this->thread = null;
     $this->channel = null;
 }
コード例 #2
0
ファイル: Fork.php プロジェクト: icicleio/concurrent
 /**
  * {@inheritdoc}
  */
 public function kill()
 {
     if ($this->isRunning()) {
         // Forcefully kill the process using SIGKILL.
         posix_kill($this->pid, SIGKILL);
     }
     if (null !== $this->pipe && $this->pipe->isOpen()) {
         $this->pipe->close();
     }
     // "Detach" from the process and let it die asynchronously.
     $this->pid = 0;
     $this->channel = null;
 }