diff --git a/src/Server.php b/src/Server.php index 6e2d65412..c515f32dc 100644 --- a/src/Server.php +++ b/src/Server.php @@ -1357,7 +1357,6 @@ class Server{ if(isset($this->console)){ $this->getLogger()->debug("Closing console"); - $this->console->shutdown(); $this->console->quit(); } diff --git a/src/console/ConsoleReaderThread.php b/src/console/ConsoleReaderThread.php index 08caec796..f1cca9bb3 100644 --- a/src/console/ConsoleReaderThread.php +++ b/src/console/ConsoleReaderThread.php @@ -46,22 +46,16 @@ final class ConsoleReaderThread extends Thread{ private \Threaded $buffer; private ?SleeperNotifier $notifier; - public bool $shutdown = false; - public function __construct(\Threaded $buffer, ?SleeperNotifier $notifier = null){ $this->buffer = $buffer; $this->notifier = $notifier; } - public function shutdown() : void{ - $this->shutdown = true; - } - protected function onRun() : void{ $buffer = $this->buffer; $notifier = $this->notifier; - while(!$this->shutdown){ + while(!$this->isKilled){ $this->runSubprocess($buffer, $notifier); } } @@ -105,7 +99,7 @@ final class ConsoleReaderThread extends Thread{ throw new AssumptionFailedError("stream_socket_accept() returned false"); } stream_socket_shutdown($server, STREAM_SHUT_RDWR); - while(!$this->shutdown){ + while(!$this->isKilled){ $r = [$client]; $w = null; $e = null;