mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-28 06:09:57 +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->tasks = [];
|
||||
|
||||
$this->collectWorkers();
|
||||
}
|
||||
|
||||
private function collectWorkers(){
|
||||
foreach($this->workers as $worker){
|
||||
$worker->collect();
|
||||
}
|
||||
}
|
||||
|
||||
public function collectTasks(){
|
||||
@ -158,9 +166,7 @@ class AsyncPool{
|
||||
}
|
||||
}
|
||||
|
||||
foreach($this->workers as $worker){
|
||||
$worker->collect();
|
||||
}
|
||||
$this->collectWorkers();
|
||||
|
||||
Timings::$schedulerAsyncTimer->stopTiming();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user