Remove syncronization from estimateProgress() function
This commit is contained in:
parent
659fb99eb6
commit
f1f2336dff
|
@ -65,11 +65,13 @@ public class CombinedRenderTask<T extends RenderTask> implements RenderTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized double estimateProgress() {
|
public double estimateProgress() {
|
||||||
if (!hasMoreWork()) return 1;
|
if (!hasMoreWork()) return 1;
|
||||||
|
int currentTask = this.currentTaskIndex;
|
||||||
|
if (currentTask >= this.tasks.size()) return 1;
|
||||||
|
|
||||||
double total = currentTaskIndex;
|
double total = currentTask;
|
||||||
total += this.tasks.get(this.currentTaskIndex).estimateProgress();
|
total += this.tasks.get(currentTask).estimateProgress();
|
||||||
|
|
||||||
return total / tasks.size();
|
return total / tasks.size();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue