diff --git a/src/scheduler/AsyncPool.php b/src/scheduler/AsyncPool.php index a326bc87f..7540294ef 100644 --- a/src/scheduler/AsyncPool.php +++ b/src/scheduler/AsyncPool.php @@ -259,7 +259,7 @@ class AsyncPool{ if($task->isTerminated()){ $this->checkCrashedWorker($worker, $task); throw new AssumptionFailedError("checkCrashedWorker() should have thrown an exception, making this unreachable"); - }elseif(!$task->hasCancelledRun()){ + }else{ /* * It's possible for a task to submit a progress update and then finish before the progress * update is detected by the parent thread, so here we consume any missed updates. diff --git a/src/scheduler/AsyncTask.php b/src/scheduler/AsyncTask.php index 9d69bda5b..ba5cc424c 100644 --- a/src/scheduler/AsyncTask.php +++ b/src/scheduler/AsyncTask.php @@ -72,17 +72,14 @@ abstract class AsyncTask extends Runnable{ private ?ThreadSafeArray $progressUpdates = null; private ThreadSafe|string|int|bool|null|float $result = null; - private bool $cancelRun = false; - private bool $submitted = false; + private bool $submitted = false; private bool $finished = false; public function run() : void{ $this->result = null; - if(!$this->cancelRun){ - $this->onRun(); - } + $this->onRun(); $this->finished = true; $worker = NativeThread::getCurrentThread(); @@ -123,12 +120,18 @@ abstract class AsyncTask extends Runnable{ $this->result = is_scalar($result) || is_null($result) || $result instanceof ThreadSafe ? $result : new NonThreadSafeValue($result); } + /** + * @deprecated + */ public function cancelRun() : void{ - $this->cancelRun = true; + //NOOP } + /** + * @deprecated + */ public function hasCancelledRun() : bool{ - return $this->cancelRun; + return false; } public function setSubmitted() : void{