fixed thr bug that empty job can't finish correctly
This commit is contained in:
@@ -106,12 +106,14 @@ internal class WorkerThread : IDisposable
|
|||||||
if (jobInfo.pExecutionFunc != null)
|
if (jobInfo.pExecutionFunc != null)
|
||||||
{
|
{
|
||||||
var ctx = new JobExecutionContext(_index, _scheduler);
|
var ctx = new JobExecutionContext(_index, _scheduler);
|
||||||
if (jobInfo.pExecutionFunc(jobInfo.pJobData, ref jobInfo.jobRanges, ref jobInfo.remainingBatches, in ctx))
|
if (!jobInfo.pExecutionFunc(jobInfo.pJobData, ref jobInfo.jobRanges, ref jobInfo.remainingBatches, in ctx))
|
||||||
{
|
{
|
||||||
// If the job returns true, it means we are the last worker to process this job.
|
// If the job returns false, it means it we are not the last worker to process this job, so we should not mark it as complete yet.
|
||||||
_scheduler.MarkJobComplete(handle);
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_scheduler.MarkJobComplete(handle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user