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
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

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