mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-13 13:25:16 +00:00
Do not block when killing workers
This commit is contained in:
parent
8abe95309c
commit
ed942100ec
@ -477,14 +477,14 @@ namespace pocketmine {
|
|||||||
$logger->debug("Stopping " . (new \ReflectionClass($thread))->getShortName() . " thread");
|
$logger->debug("Stopping " . (new \ReflectionClass($thread))->getShortName() . " thread");
|
||||||
if($thread instanceof Thread){
|
if($thread instanceof Thread){
|
||||||
$thread->kill();
|
$thread->kill();
|
||||||
|
sleep(1);
|
||||||
if($thread->isRunning() or !$thread->join()){
|
if($thread->isRunning()){
|
||||||
$thread->detach();
|
$thread->detach();
|
||||||
}
|
}
|
||||||
}elseif($thread instanceof Worker){
|
}elseif($thread instanceof Worker){
|
||||||
$thread->kill();
|
$thread->kill();
|
||||||
sleep(1);
|
sleep(1);
|
||||||
if($thread->isRunning() or !$thread->join()){
|
if($thread->isRunning()){
|
||||||
$thread->detach();
|
$thread->detach();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user