Most pointless optimization ever (ServerKiller)

This commit is contained in:
Dylan K. Taylor 2018-02-19 12:20:31 +00:00
parent d7a02793fa
commit e7b2dc87d6
2 changed files with 2 additions and 1 deletions

View File

@ -307,7 +307,7 @@ namespace pocketmine {
$logger->info("Stopping other threads");
$killer = new ServerKiller(8);
$killer->start();
$killer->start(PTHREADS_INHERIT_NONE);
usleep(10000); //Fixes ServerKiller not being able to start on single-core machines
if(ThreadManager::getInstance()->stopAll() > 0){

View File

@ -34,6 +34,7 @@ class ServerKiller extends Thread{
}
public function run(){
$this->registerClassLoader();
$start = time();
$this->synchronized(function(){
$this->wait($this->time * 1000000);