mirror of
https://github.com/CivMC/Civ.git
synced 2026-07-18 08:30:59 +00:00
handle interruptedexception correctly
This commit is contained in:
@@ -34,13 +34,17 @@ public class ChunkMetaListener implements Listener {
|
||||
this.viewTracker = viewTracker;
|
||||
this.unloadQueue = new LinkedBlockingQueue<>();
|
||||
unloadConsumer = new Thread(() -> {
|
||||
while (true) {
|
||||
try {
|
||||
Chunk chunk = unloadQueue.take();
|
||||
manager.unloadChunkData(chunk);
|
||||
} catch (RuntimeException | InterruptedException e) {
|
||||
CHUNK_META_LOGGER.warn("Handling chunk unloads", e);
|
||||
try {
|
||||
while (true) {
|
||||
try {
|
||||
Chunk chunk = unloadQueue.take();
|
||||
manager.unloadChunkData(chunk);
|
||||
} catch (RuntimeException e) {
|
||||
CHUNK_META_LOGGER.warn("Handling chunk unloads", e);
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}, "CivModCore chunk unload handler");
|
||||
unloadConsumer.start();
|
||||
|
||||
Reference in New Issue
Block a user