Skip to content

Commit 4714799

Browse files
committed
fix: another fix for concurrency
1 parent 44b2b53 commit 4714799

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

c2me-base/src/main/java/com/ishland/c2me/base/common/scheduler/SchedulingManager.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ public class SchedulingManager {
1818

1919
public static final int MAX_LEVEL = ChunkLevels.INACCESSIBLE + 1;
2020
private final ConcurrentMap<Long, FreeableTaskList> pos2Tasks = new ConcurrentHashMap<>();
21-
private final Long2IntOpenHashMap prioritiesFromLevel = new Long2IntOpenHashMap();
21+
private final Long2IntOpenHashMap prioritiesFromLevel = new Long2IntOpenHashMap() {
22+
@Override
23+
protected void rehash(int newN) {
24+
if (n < newN) {
25+
super.rehash(newN);
26+
}
27+
}
28+
};
2229
private final StampedLock prioritiesLock = new StampedLock();
2330
private final int id = COUNTER.getAndIncrement();
2431
private volatile ChunkPos currentSyncLoad = null;

0 commit comments

Comments
 (0)