Commit e5568d53 authored by hpi1's avatar hpi1

BDJThreadGroup: error out in waitForShutdown if waiting for current thread to terminate

parent d50f78bc
......@@ -52,6 +52,12 @@ public class BDJThreadGroup extends ThreadGroup {
}
public boolean waitForShutdown(int timeout, int maxThreads) {
if (parentOf(Thread.currentThread().getThreadGroup()) && maxThreads < 1) {
logger.error("Current Thread is contained within ThreadGroup to be disposed.");
throw new IllegalThreadStateException("Current Thread is contained within ThreadGroup to be disposed.");
}
long startTime = System.currentTimeMillis();
long endTime = startTime + timeout;
while ((activeCount() > maxThreads) &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment