How to join the main thread to a thread pool in java
Like joining two threads using join(), is there a way to join a thread to a ExecutorService object (a thread 开发者_开发问答pool) ?
According to the docs, you could, from your second thread, call the shutdown method of your executor service and next, call for awaitTermination. This method will block till completion of all submitted jobs in the executor service.
精彩评论