Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7765c6d

Browse files
author
Max Schaefer
committed
JavaScript: Await termination of extractor threadpool.
1 parent 3b5315a commit 7765c6d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.util.Set;
2222
import java.util.concurrent.ExecutorService;
2323
import java.util.concurrent.Executors;
24+
import java.util.concurrent.TimeUnit;
2425
import java.util.stream.Stream;
2526

2627
import com.semmle.js.extractor.ExtractorConfig.SourceType;
@@ -403,8 +404,14 @@ private void startThreadPool() {
403404
}
404405

405406
private void shutdownThreadPool() {
406-
if (threadPool != null)
407+
if (threadPool != null) {
407408
threadPool.shutdown();
409+
try {
410+
threadPool.awaitTermination(365, TimeUnit.DAYS);
411+
} catch (InterruptedException e) {
412+
Exceptions.ignore(e, "Awaiting termination is not essential.");
413+
}
414+
}
408415
}
409416

410417
/**

0 commit comments

Comments
 (0)