More error logging

This commit is contained in:
mcrcortex
2025-03-09 12:05:08 +10:00
parent fd4d1d7910
commit 60b878d53c
2 changed files with 7 additions and 2 deletions

View File

@@ -13,7 +13,7 @@ import java.util.function.BooleanSupplier;
import java.util.function.Supplier;
public class ServiceSlice extends TrackedObject {
private final String name;
final String name;
final int weightPerJob;
volatile boolean alive = true;
private final ServiceThreadPool threadPool;

View File

@@ -3,6 +3,7 @@ package me.cortex.voxy.common.thread;
import me.cortex.voxy.common.Logger;
import me.cortex.voxy.common.util.Pair;
import java.util.Arrays;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
@@ -204,7 +205,11 @@ public class ServiceThreadPool {
public void shutdown() {
if (this.serviceSlices.length != 0) {
throw new IllegalStateException("All service slices must be shutdown before thread pool can exit");
String remaining = "";
for (var service : this.serviceSlices) {
remaining += service.name + ", ";
}
throw new IllegalStateException("All service slices must be shutdown before thread pool can exit. Remaining: " + remaining);
}
//Wait for the tasks to finish