Do not block when killing workers

This commit is contained in:
Shoghi Cervantes 2014-10-15 17:49:08 +02:00
parent 8abe95309c
commit ed942100ec

View File

@ -477,14 +477,14 @@ namespace pocketmine {
$logger->debug("Stopping " . (new \ReflectionClass($thread))->getShortName() . " thread");
if($thread instanceof Thread){
$thread->kill();
if($thread->isRunning() or !$thread->join()){
sleep(1);
if($thread->isRunning()){
$thread->detach();
}
}elseif($thread instanceof Worker){
$thread->kill();
sleep(1);
if($thread->isRunning() or !$thread->join()){
if($thread->isRunning()){
$thread->detach();
}
}