diff --git a/src/thread/Worker.php b/src/thread/Worker.php index 1315202b1..572da3c67 100644 --- a/src/thread/Worker.php +++ b/src/thread/Worker.php @@ -56,7 +56,9 @@ abstract class Worker extends \Worker{ $this->isKilled = true; if(!$this->isShutdown()){ - while($this->unstack() !== null); + $this->synchronized(function() : void{ + while($this->unstack() !== null); + }); $this->notify(); $this->shutdown(); }