mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Worker: fixed quit() usually being useless
Worker::isRunning() returns false after it exits the run() function, even if tasks are stacked and it isn't shutdown. While this is mostly harmless (since the internal destructor will join the thread anyway), this should be fixed anyway.
This commit is contained in:
@ -95,7 +95,7 @@ abstract class Worker extends \Worker{
|
||||
public function quit(){
|
||||
$this->isKilled = true;
|
||||
|
||||
if($this->isRunning()){
|
||||
if(!$this->isShutdown()){
|
||||
while($this->unstack() !== null);
|
||||
$this->notify();
|
||||
$this->shutdown();
|
||||
|
Reference in New Issue
Block a user