mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Fix mode fail due to pres svc
This commit is contained in:
parent
aee42cdecc
commit
4ba8ecd3fd
@ -32,14 +32,16 @@ import com.volmit.iris.util.scheduling.Looper;
|
|||||||
import com.volmit.iris.util.stream.utility.CachedStream2D;
|
import com.volmit.iris.util.stream.utility.CachedStream2D;
|
||||||
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
|
|
||||||
public class PreservationSVC implements IrisService {
|
public class PreservationSVC implements IrisService {
|
||||||
private final KList<Thread> threads = new KList<>();
|
private final List<Thread> threads = new CopyOnWriteArrayList<>();
|
||||||
private final KList<ExecutorService> services = new KList<>();
|
private final List<ExecutorService> services = new CopyOnWriteArrayList<>();
|
||||||
private Looper dereferencer;
|
private Looper dereferencer;
|
||||||
private final KList<MeteredCache> caches = new KList<>();
|
private final List<MeteredCache> caches = new CopyOnWriteArrayList<>();
|
||||||
|
|
||||||
public void register(Thread t) {
|
public void register(Thread t) {
|
||||||
threads.add(t);
|
threads.add(t);
|
||||||
@ -79,8 +81,8 @@ public class PreservationSVC implements IrisService {
|
|||||||
public void dereference() {
|
public void dereference() {
|
||||||
IrisContext.dereference();
|
IrisContext.dereference();
|
||||||
IrisData.dereference();
|
IrisData.dereference();
|
||||||
threads.removeWhere((i) -> !i.isAlive());
|
threads.removeIf((i) -> !i.isAlive());
|
||||||
services.removeWhere(ExecutorService::isShutdown);
|
services.removeIf(ExecutorService::isShutdown);
|
||||||
updateCaches();
|
updateCaches();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,7 +131,7 @@ public class PreservationSVC implements IrisService {
|
|||||||
|
|
||||||
public void updateCaches()
|
public void updateCaches()
|
||||||
{
|
{
|
||||||
caches.removeWhere(MeteredCache::isClosed);
|
caches.removeIf(MeteredCache::isClosed);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void registerCache(MeteredCache cache) {
|
public void registerCache(MeteredCache cache) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user