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);}
|
||||
}
|
||||
}
|
||||
// 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;
|
||||
if(currentlyActive != null)
|
||||
currentlyActive.terminate();
|
||||
}
|
||||
public synchronized void terminate(){
|
||||
terminateNonBlock();
|
||||
|
||||
// Wait for the execution to finnish
|
||||
if(isRunning()){
|
||||
|
|
@ -108,7 +113,7 @@ public class UeControlExecutor implements Runnable, UeBehaviour.DataHandledListe
|
|||
while(!terminate) {
|
||||
if(behaviours.isEmpty()) {
|
||||
currentlyActive = null;
|
||||
terminate();
|
||||
terminateNonBlock();
|
||||
synchronized (thread){thread.notifyAll();}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue