开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜