v0.6.0b: removed usage of thread state checking logic, too unreliable
This commit is contained in:
parent
804c3aea83
commit
4467146d33
|
@ -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.
|
//tell the actor thread to finish, then wait for it to complete any actions it may be doing.
|
||||||
if (actorThread.isAlive()){
|
if (actorThread.isAlive()){
|
||||||
synchronized (GameScene.class){
|
synchronized (GameScene.class){
|
||||||
synchronized (actorThread) {
|
synchronized (actorThread) {
|
||||||
actorThread.interrupt();
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user