Skip to content

Commit 8ed7488

Browse files
committed
In the CountDownLatch_6.App#App ; the thread pool must be shut down ... Otherwise the app (main thread) wont stop executing after the last line.
1 parent 460eb93 commit 8ed7488

File tree

1 file changed

+2
-0
lines changed
  • JavaMultiThreadingCodes/src/CountDownLatch_6

1 file changed

+2
-0
lines changed

JavaMultiThreadingCodes/src/CountDownLatch_6/App.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ public static void main(String[] args) {
5858
for (int i = 0; i < 3; i++) {
5959
executor.submit(new Processor(latch));
6060
}
61+
executor.shutdown();
62+
6163
try {
6264
// Application’s main thread waits, till other service threads which are
6365
// as an example responsible for starting framework services have completed started all services.

0 commit comments

Comments
 (0)