Adds a task to be tracked by this ExecutorServiceCounter. If this method
is invoked from a ForkJoinPool worker thread, the task is forked in that
ForkJoinPool. Otherwise, it is submitted to the ExecutorService backing
task - the task
public void blockUntilFinished()
Blocks the calling thread until this ExecutorServiceCounter has no
pending or incomplete tasks.
public void shutdownAndAwaitTermination()
Shutdowns the ExecutorService backing this ExecutorServiceCounter (i.e.,
so it stops accepting new tasks) and blocks until any outstanding tasks
have been completed.