Fix ServerKiller and make it less useless (#122)

This commit is contained in:
Dylan K. Taylor 2016-11-24 08:47:28 +00:00 committed by GitHub
parent fe348b0a9d
commit 744f5a8384
2 changed files with 4 additions and 4 deletions

View File

@ -484,14 +484,14 @@ namespace pocketmine {
$logger->info("Stopping other threads");
$killer = new ServerKiller(8);
$killer->start();
foreach(ThreadManager::getInstance()->getAll() as $id => $thread){
$logger->debug("Stopping " . $thread->getThreadName() . " thread");
$thread->quit();
}
$killer = new ServerKiller(8);
$killer->start();
$logger->shutdown();
$logger->join();

View File

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