Issue #2498 - new QTP.removeThread(Thread) method (#2499)

+ Adding removeThread(Thread) to allow instrumentation
  libraries to track removal of threads from Pool.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
Joakim Erdfelt 2018-05-02 16:32:49 -05:00 committed by Greg Wilkins
parent 61c2bb362a
commit 1f835b9f23
1 changed files with 6 additions and 1 deletions

View File

@ -554,6 +554,11 @@ public class QueuedThreadPool extends ContainerLifeCycle implements SizedThreadP
return new Thread(_threadGroup, runnable);
}
protected void removeThread(Thread thread)
{
_threads.remove(thread);
}
@Override
public void dump(Appendable out, String indent) throws IOException
{
@ -739,7 +744,7 @@ public class QueuedThreadPool extends ContainerLifeCycle implements SizedThreadP
if (_threadsStarted.decrementAndGet()<getMaxThreads())
startThreads(1);
}
_threads.remove(Thread.currentThread());
removeThread(Thread.currentThread());
}
}
};