multithreading issue
hello, I need a suggestion for multithreading issue.
I download remote data from two URL sources. In main thread I create 2 new threads which asynch. downloading is performed. When I created this threads in main thread I wait until all threads for data downloading is done.
public void doSomething() {
DownloadThread t1 = new DownloadThread(url);
t1.start();
DownloadThread t2 = new DownloadThread(url);
t2.start();
// here I want wait until both threads will done
// ?
}
class DownloadThread extends Thread {
public void run() {
// downloading
}
public boolean isComplete() {
return true; // if downloaded is done
}
}

