This assumes that after activeJobs is empty, no new job will ever get added. This is true, if the client code works synchronously and really waits but does not call addToListOfStartedJobs(). Maybe this should be documented, that addToListOfStartedJobs()/submitJobs() should not be called while waitForJobstoFinIsh() is waiting.
A thread-safe (and thus preferable) alternative would be to block job submission while waiting for jobs.
This assumes that after activeJobs is empty, no new job will ever get added. This is true, if the client code works synchronously and really waits but does not call
addToListOfStartedJobs()
. Maybe this should be documented, thataddToListOfStartedJobs()
/submitJobs()
should not be called whilewaitForJobstoFinIsh()
is waiting.A thread-safe (and thus preferable) alternative would be to block job submission while waiting for jobs.
Originally posted by @vinjana in https://github.com/TheRoddyWMS/BatchEuphoria/pull/129