v0.6.1: improved actor thread interrupt handling

This commit is contained in:
Evan Debenham 2017-06-22 17:23:59 -04:00
parent 2c54c53c54
commit 1757c2ae7d

View File

@ -231,13 +231,20 @@ public abstract class Actor implements Bundlable {
} }
if (!doNext){ if (!doNext){
interrupted = false;
synchronized (Thread.currentThread()) { synchronized (Thread.currentThread()) {
interrupted = interrupted || Thread.interrupted();
if (interrupted){
current = null;
interrupted = false;
}
synchronized (GameScene.class){ synchronized (GameScene.class){
//signals to the gamescene that actor processing is finished for now //signals to the gamescene that actor processing is finished for now
GameScene.class.notify(); GameScene.class.notify();
} }
try { try {
Thread.currentThread().wait(); Thread.currentThread().wait();
} catch (InterruptedException e) { } catch (InterruptedException e) {