Here you can find the source of waitForAll(List
Parameter | Description |
---|---|
res | must not be null. |
public static void waitForAll(List<Future<Void>> res)
//package com.java2s; //License from project: Open Source License import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; public class Main { /**/*from www. j a v a 2 s . c o m*/ * For lists of Future results that we are uninterested in, act as a Barrier * and attempt to get all futures. Exceptions will be silently ignored. * * @param res must not be null. */ public static void waitForAll(List<Future<Void>> res) { for (Future<?> f : res) try { f.get(); } catch (InterruptedException | ExecutionException e) { // Don't worry about it. } } }