mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-13 21:35:21 +00:00
Fix ServerKiller and make it less useless (#122)
This commit is contained in:
parent
fe348b0a9d
commit
744f5a8384
@ -484,14 +484,14 @@ namespace pocketmine {
|
|||||||
|
|
||||||
$logger->info("Stopping other threads");
|
$logger->info("Stopping other threads");
|
||||||
|
|
||||||
|
$killer = new ServerKiller(8);
|
||||||
|
$killer->start();
|
||||||
|
|
||||||
foreach(ThreadManager::getInstance()->getAll() as $id => $thread){
|
foreach(ThreadManager::getInstance()->getAll() as $id => $thread){
|
||||||
$logger->debug("Stopping " . $thread->getThreadName() . " thread");
|
$logger->debug("Stopping " . $thread->getThreadName() . " thread");
|
||||||
$thread->quit();
|
$thread->quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$killer = new ServerKiller(8);
|
|
||||||
$killer->start();
|
|
||||||
|
|
||||||
$logger->shutdown();
|
$logger->shutdown();
|
||||||
$logger->join();
|
$logger->join();
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ class ServerKiller extends Thread{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function run(){
|
public function run(){
|
||||||
$start = time() + 1;
|
$start = time();
|
||||||
$this->synchronized(function(){
|
$this->synchronized(function(){
|
||||||
$this->wait($this->time * 1000000);
|
$this->wait($this->time * 1000000);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user