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