[history] Fix incremental loading: reduce number of spawned jobs
commit6f34f362fe85e2a409935d663175d744da384275
authorThomas Wolf <thomas.wolf@paranor.ch>
Tue, 21 Dec 2021 11:04:36 +0000 (21 12:04 +0100)
committerThomas Wolf <thomas.wolf@paranor.ch>
Tue, 21 Dec 2021 11:04:36 +0000 (21 12:04 +0100)
tree7abc474e342a52a4c567d2509052f421f1ab73a8
parent56f9d752515ddb86da4384767eed763644f1dd4f
[history] Fix incremental loading: reduce number of spawned jobs

Incremental history loading in some cases scheduled way too many
background threads to load the next batch of commits. Change the
logic to account for the history already being fully loaded, and
to avoid scheduling unnecessary jobs.

Make the logic thread-safe. Copy the relevant data (number of already
loaded commits and whether the history is fully loaded) from the commit
list into local fields so that the job is still the only entity that
accesses the commit list.

Bug: 577913
Change-Id: I4fe55f5c55a5a4b729d764e0074b692cf61ad002
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java