JAL-1359 simpler logic for deciding if all threads have finished.