v0.6.1: improved actor thread interrupt handling
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user