List of usage examples for java.util.concurrent ForkJoinPool getQueuedSubmissionCount
public int getQueuedSubmissionCount()
From source file:uniol.apt.analysis.synthesize.FindWords.java
static private <T> int submitTasks(ForkJoinPool executor, CompletionService<T> completion, Iterator<Callable<T>> jobGenerator) { int submitted = 0; while (jobGenerator.hasNext() && executor.getQueuedSubmissionCount() < TARGET_JOB_QUEUE_SIZE) { completion.submit(jobGenerator.next()); submitted++;/*from w ww. j av a 2s . com*/ } return submitted; }