My question is strongly related to this one here.
As was posted there, I would like the main thread to wait until the work queue is empty and all tasks have finished. The pr
If you know number of threads to wait and can paste one line of code to increase number for each thread with help of CountDownLatch (
http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/CountDownLatch.html )
It can resolve you problem