Fixed pthreads crashes with progressUpdates

This commit is contained in:
SOFe
2016-11-12 18:30:55 +08:00
parent 7861822a0f
commit 8404ce88bd
3 changed files with 16 additions and 7 deletions

View File

@ -142,11 +142,8 @@ class AsyncPool{
Timings::$schedulerAsyncTimer->startTiming();
foreach($this->tasks as $task){
if(!$task->isGarbage() and $task->progressUpdates !== null){
if($task->progressUpdates->count() !== 0){
$progress = $task->progressUpdates->shift();
$task->onProgressUpdate($this->server, $progress);
}
if(!$task->isGarbage()){
$task->checkProgressUpdates($this->server);
}
if($task->isGarbage() and !$task->isRunning() and !$task->isCrashed()){
if(!$task->hasCancelledRun()){