v0.6.0b: removed usage of thread state checking logic, too unreliable

This commit is contained in:
Evan Debenham 2017-06-11 05:06:21 -04:00
parent 804c3aea83
commit 4467146d33

View File

@ -417,20 +417,20 @@ public class GameScene extends PixelScene {
//tell the actor thread to finish, then wait for it to complete any actions it may be doing.
if (actorThread.isAlive()){
synchronized (GameScene.class){
synchronized (actorThread) {
actorThread.interrupt();
synchronized (actorThread) {
actorThread.interrupt();
}
try {
GameScene.class.wait(5000);
} catch (InterruptedException e) {
ShatteredPixelDungeon.reportException(e);
}
synchronized (actorThread) {
if (Actor.processing()) {
Throwable t = new Throwable();
t.setStackTrace(actorThread.getStackTrace());
throw new RuntimeException("timeout waiting for actor thread! ", t);
}
try {
GameScene.class.wait(5000);
} catch (InterruptedException e) {
ShatteredPixelDungeon.reportException(e);
}
synchronized (actorThread) {
if (actorThread.getState() != Thread.State.WAITING) {
Throwable t = new Throwable();
t.setStackTrace(actorThread.getStackTrace());
throw new RuntimeException("timeout waiting for actor thread! ", t);
}
}
}
}