If you are using an ExecutorService you can do
ExecutorService es = /* create a reusable thread pool */
List<Future> futures = new ArrayList<Future>();
futures.add(es.submit(myRunnable1));
futures.add(es.submit(myRunnable2));
futures.add(es.submit(myRunnable3));
for(Future f: futures) f.get(); // wait for them to finish.
If you want to return a boolean, you should use a Callable instead. You can also use invokeAll
ExecutorService es = /* create a reusable thread pool */
List<Future<Boolean>> futures = new ArrayList<Future<Boolean>>();
es.invokeAll(Arrays.asList(
new Callable<Boolean>() {
public Boolean call() {
return true;
}
},
new Callable<Boolean>() {
public Boolean call() {
return false;
}
},
new Callable<Boolean>() {
public Boolean call() {
return true;
}
}
));
for(Future<Boolean> f: futures) {
Boolean result = f.get();
}