Skip to content

Commit

Permalink
fix: no-tick pending chunk loads counter
Browse files Browse the repository at this point in the history
  • Loading branch information
ishland committed Jan 2, 2025
1 parent 2204d33 commit 6073966
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,6 @@ public void tick() {
}

this.tickFutures();

{
long pendingLoadsCount = 0L;
ObjectBidirectionalIterator<Long2ReferenceMap.Entry<ChunkIterator>> iterator = this.iterators.long2ReferenceEntrySet().fastIterator();
while (iterator.hasNext()) {
Long2ReferenceMap.Entry<ChunkIterator> entry = iterator.next();
pendingLoadsCount += entry.getValue().remaining();
}
this.pendingLoadsCountSnapshot = pendingLoadsCount;
}
}

private void clearTickets() {
Expand All @@ -142,6 +132,16 @@ void tickFutures() {

if (this.closing.get()) return;
while (this.chunkLoadFutures.size() < Config.maxConcurrentChunkLoads && this.addOneTicket());

{
long pendingLoadsCount = 0L;
ObjectBidirectionalIterator<Long2ReferenceMap.Entry<ChunkIterator>> iterator = this.iterators.long2ReferenceEntrySet().fastIterator();
while (iterator.hasNext()) {
Long2ReferenceMap.Entry<ChunkIterator> entry = iterator.next();
pendingLoadsCount += entry.getValue().remaining();
}
this.pendingLoadsCountSnapshot = pendingLoadsCount;
}
}

private boolean addOneTicket() {
Expand Down

0 comments on commit 6073966

Please sign in to comment.