Hi,
I wonder why when I call run() on a JobControl object, it loops forever.
Namely, this code doesn't work:
JobControl jobControl = new JobControl("Name");
// some stuff here (add jobs and dependencies)
jobControl.run();
This code works but looks a bit ugly:
JobControl jobControl = new JobControl("Name");
// some stuff here (add jobs and dependencies)
Thread control = new Thread(jobControl);
control.start();
while (!jobControl.allFinished()) {
try {
Thread.sleep(5000);
}
catch (Exception e) {}
}
I wonder if the run method in the JobControl class could add the following
condition to break the while(true) loop:
if (jobsInProgress.isEmpty()) {
break;
}
Thanks very much,
Juan