mirror of
https://github.com/jneug/zeichenmaschine.git
synced 2026-04-14 06:33:34 +02:00
Bug: UpdateThreadExecutor blockt nun korrekt den Zeichenthread
This commit is contained in:
@@ -1638,7 +1638,7 @@ public class Zeichenmaschine extends Constants {
|
||||
|
||||
private Thread updateThread;
|
||||
|
||||
private boolean running = false, waiting = false;
|
||||
private boolean running = false;
|
||||
|
||||
public UpdateThreadExecutor() {
|
||||
super(1, 1, 0L,
|
||||
@@ -1646,13 +1646,18 @@ public class Zeichenmaschine extends Constants {
|
||||
updateState = Options.AppState.IDLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute( Runnable command ) {
|
||||
running = true;
|
||||
super.execute(command);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void beforeExecute( Thread t, Runnable r ) {
|
||||
// We store the one Thread this Executor holds
|
||||
// We store the one Thread this Executor holds,
|
||||
// but it might change if a new Thread needed to be spawned
|
||||
// due to en error.
|
||||
updateThread = t;
|
||||
running = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1683,7 +1688,10 @@ public class Zeichenmaschine extends Constants {
|
||||
* @return
|
||||
*/
|
||||
public boolean isWaiting() {
|
||||
return running && updateThread.getState() == Thread.State.TIMED_WAITING;
|
||||
//return running && updateThread.getState() == Thread.State.TIMED_WAITING;
|
||||
return running && updateThread != null && updateThread.getState() == Thread.State.TIMED_WAITING;
|
||||
//|| updateThread.getState() == Thread.State.WAITING
|
||||
//|| updateThread.getState() == Thread.State.BLOCKED;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user