Java examples for java.lang:Thread
Wait for an array of threads to finish their processes
//package com.java2s; public class Main { /**/*from w w w . ja va 2s. co m*/ * Wait for an array of threads to finish their processes * @param threads The array of threads to wait for */ public static void waitForThreads(Thread[] threads) { try { for (Thread thread : threads) thread.join(); } catch (InterruptedException ex) { ex.printStackTrace(); } } }