From 744f5a83844fa69a345f84153c50fb8295abc11a Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 24 Nov 2016 08:47:28 +0000 Subject: [PATCH] Fix ServerKiller and make it less useless (#122) --- src/pocketmine/PocketMine.php | 6 +++--- src/pocketmine/utils/ServerKiller.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pocketmine/PocketMine.php b/src/pocketmine/PocketMine.php index 4293cc77b..de6508b2b 100644 --- a/src/pocketmine/PocketMine.php +++ b/src/pocketmine/PocketMine.php @@ -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(); diff --git a/src/pocketmine/utils/ServerKiller.php b/src/pocketmine/utils/ServerKiller.php index 8bc2521d0..c6ed2beb3 100644 --- a/src/pocketmine/utils/ServerKiller.php +++ b/src/pocketmine/utils/ServerKiller.php @@ -32,7 +32,7 @@ class ServerKiller extends Thread{ } public function run(){ - $start = time() + 1; + $start = time(); $this->synchronized(function(){ $this->wait($this->time * 1000000); });