Fixed Cache thread as daemon

This commit is contained in:
Jindra Petřík
2023-01-22 21:33:27 +01:00
parent 40ea1e4aa3
commit 1775de1e74
2 changed files with 3 additions and 1 deletions

View File

@@ -56,7 +56,7 @@ public class Cache<K, V> implements Freed {
private static final long CLEAN_INTERVAL = 5 * 1000; //5 seconds
private static Thread oldCleaner = null;
private static Thread oldCleaner = null;
static {
Runtime.getRuntime().addShutdownHook(new Thread() {
@@ -90,6 +90,7 @@ public class Cache<K, V> implements Freed {
}
}
};
oldCleaner.setDaemon(true);
oldCleaner.setPriority(Thread.MIN_PRIORITY);
oldCleaner.start();
}