ConsoleReaderThread: remove useless code

This commit is contained in:
Dylan K. Taylor 2021-09-10 13:54:42 +01:00
parent 1cc57afd25
commit 32588d79c8
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
2 changed files with 2 additions and 9 deletions

View File

@ -1357,7 +1357,6 @@ class Server{
if(isset($this->console)){
$this->getLogger()->debug("Closing console");
$this->console->shutdown();
$this->console->quit();
}

View File

@ -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;