Fix thread switch

This commit is contained in:
Daniel Mills 2021-07-29 14:48:32 -04:00
parent 9a43f868aa
commit 6dad50aab1
3 changed files with 9 additions and 5 deletions

View File

@ -168,14 +168,13 @@ public class VisionGUI extends JPanel implements MouseWheelListener, KeyListener
try
{
engine = IrisWorlds.access(world.realWorld()).getCompound().getEngine(index);
return !engine.isClosed();
}
catch(Throwable e)
{
engine = IrisWorlds.access(world.realWorld()).getCompound().getDefaultEngine();
}
return true;
}
}
}

View File

@ -55,7 +55,7 @@ public class EngineTarget {
}
public void close() {
parallaxBurster.shutdownAndAwait();
burster.shutdownAndAwait();
parallaxBurster.shutdownLater();
burster.shutdownLater();
}
}

View File

@ -21,6 +21,7 @@ package com.volmit.iris.engine.parallel;
import com.volmit.iris.Iris;
import com.volmit.iris.core.IrisSettings;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.scheduling.J;
import java.util.concurrent.*;
@ -96,6 +97,10 @@ public class MultiBurst {
service.shutdown();
}
public void shutdownLater() {
J.a(service::shutdown, 100);
}
public void shutdownAndAwait() {
service.shutdown();