mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 11:58:00 +00:00
Collect workers when cancelling all tasks
This commit is contained in:
@@ -136,6 +136,14 @@ class AsyncPool{
|
|||||||
|
|
||||||
$this->taskWorkers = [];
|
$this->taskWorkers = [];
|
||||||
$this->tasks = [];
|
$this->tasks = [];
|
||||||
|
|
||||||
|
$this->collectWorkers();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function collectWorkers(){
|
||||||
|
foreach($this->workers as $worker){
|
||||||
|
$worker->collect();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function collectTasks(){
|
public function collectTasks(){
|
||||||
@@ -158,9 +166,7 @@ class AsyncPool{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($this->workers as $worker){
|
$this->collectWorkers();
|
||||||
$worker->collect();
|
|
||||||
}
|
|
||||||
|
|
||||||
Timings::$schedulerAsyncTimer->stopTiming();
|
Timings::$schedulerAsyncTimer->stopTiming();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user