what is recommended to do if joining threads does not work?
for (List t : threads) {
try {
t.join();
} catch (InterruptedException e) {
log.error("Thread " + t.getId() + " interrupted: " + e);
// and now?
}
}
is it recommended to break then (what happens then with the other threads which are not joined yet?) or should you at least try to join the rest of the threads and then go on?
Thanks for advices!
==> Conclusion: You should try again to join the specific thread t or you should interrupt this specific thread t and go on.
for (List t : threads) {
try {
t.join();
} catch (InterruptedException e) {
try {
// try once! again:
t.join();
} catch (InterruptedException ex) {
// once again exception caught, so:
t.interrupt();
}
}
}
so what do you think about this solution? and is it correct to do "t.interrupt()" or should it be Thread.currentThread().interrupt(); ?
thanks! :-)