How can I check whether all tasks submitted to ThreadPoolExecutor
are completed?
New tasks can be added from previously submitted tasks, so I can't call shutdown
followed by awaitTermination
nor invokeAll
, as it will ignore these new tasks.
How can I check whether all tasks submitted to ThreadPoolExecutor
are completed?
New tasks can be added from previously submitted tasks, so I can't call shutdown
followed by awaitTermination
nor invokeAll
, as it will ignore these new tasks.