mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-19 15:35:52 +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");
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user