Prevents the thread from getting stuck when it is shut down from stopped
state.
gitlab #194
Change-Id: Iaf5ad6238aae8925c42d029078ea5f2a2ffa3e8c
};
public int runTasks() {
- ArrayList<Runnable> todo = new ArrayList<>();
+ ArrayList<Runnable> todo = new ArrayList<>(tasks.size());
synchronized(tasks) {
todo.addAll(tasks);
tasks.clear();
public void changeState(ExperimentState state) {
this.state = state;
fireStateChanged(state);
+ synchronized (tasks) {
+ tasks.notifyAll();
+ }
}
public void addListener(DynamicExperimentThreadListener listener) {