Fixed issue where empty list was freezing the app
This commit is contained in:
parent
450ca0af17
commit
e066e4431b
1 changed files with 7 additions and 2 deletions
|
|
@ -72,12 +72,17 @@ public class UeControlExecutor implements Runnable, UeBehaviour.DataHandledListe
|
||||||
try { thread.wait(); }catch(InterruptedException e) {log.error(null,e);}
|
try { thread.wait(); }catch(InterruptedException e) {log.error(null,e);}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Sleep for some time to get correct status
|
||||||
|
try{ Thread.sleep(20); }catch(Exception e){log.error(null,e);}
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void terminate(){
|
private void terminateNonBlock(){
|
||||||
terminate = true;
|
terminate = true;
|
||||||
if(currentlyActive != null)
|
if(currentlyActive != null)
|
||||||
currentlyActive.terminate();
|
currentlyActive.terminate();
|
||||||
|
}
|
||||||
|
public synchronized void terminate(){
|
||||||
|
terminateNonBlock();
|
||||||
|
|
||||||
// Wait for the execution to finnish
|
// Wait for the execution to finnish
|
||||||
if(isRunning()){
|
if(isRunning()){
|
||||||
|
|
@ -108,7 +113,7 @@ public class UeControlExecutor implements Runnable, UeBehaviour.DataHandledListe
|
||||||
while(!terminate) {
|
while(!terminate) {
|
||||||
if(behaviours.isEmpty()) {
|
if(behaviours.isEmpty()) {
|
||||||
currentlyActive = null;
|
currentlyActive = null;
|
||||||
terminate();
|
terminateNonBlock();
|
||||||
synchronized (thread){thread.notifyAll();}
|
synchronized (thread){thread.notifyAll();}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue