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:
Dylan K. Taylor
2021-05-21 01:24:07 +01:00
parent e0c61071e1
commit 61077c48f1

View File

@ -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();