From 9c28f0a5be52ca433bfb0897e8c4508284e63f07 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Mon, 5 Jan 2015 02:41:14 +0100 Subject: [PATCH] Decrease async worker task amount after crashed task --- src/pocketmine/scheduler/AsyncPool.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pocketmine/scheduler/AsyncPool.php b/src/pocketmine/scheduler/AsyncPool.php index 1fdc19815..4eea79b73 100644 --- a/src/pocketmine/scheduler/AsyncPool.php +++ b/src/pocketmine/scheduler/AsyncPool.php @@ -74,7 +74,8 @@ class AsyncPool{ private function removeTask(AsyncTask $task){ if(isset($this->taskWorkers[$task->getTaskId()])){ - $this->workers[$this->taskWorkers[$task->getTaskId()]]->unstack($task); + $this->workers[$w = $this->taskWorkers[$task->getTaskId()]]->unstack($task); + $this->workerUsage[$w]--; } unset($this->tasks[$task->getTaskId()]);