mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-28 14:19:53 +00:00
Collect workers when cancelling all tasks
This commit is contained in:
parent
00e6d6a6b1
commit
568e2760f1
@ -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();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user