This is an automated email from the ASF dual-hosted git repository. fschumacher pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jmeter.git
commit 12206c5442083b34ace41b324f4b2ee7c6888504 Author: Felix Schumacher <[email protected]> AuthorDate: Sat Aug 24 21:59:35 2019 +0200 Remove Threadlocal perThreadInt on thread exit --- .../java/org/apache/jmeter/functions/IterationCounter.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/functions/src/main/java/org/apache/jmeter/functions/IterationCounter.java b/src/functions/src/main/java/org/apache/jmeter/functions/IterationCounter.java index 88e396a..9134eec 100644 --- a/src/functions/src/main/java/org/apache/jmeter/functions/IterationCounter.java +++ b/src/functions/src/main/java/org/apache/jmeter/functions/IterationCounter.java @@ -26,6 +26,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.jmeter.engine.util.CompoundVariable; import org.apache.jmeter.samplers.SampleResult; import org.apache.jmeter.samplers.Sampler; +import org.apache.jmeter.testelement.ThreadListener; import org.apache.jmeter.threads.JMeterVariables; import org.apache.jmeter.util.JMeterUtils; @@ -34,7 +35,7 @@ import org.apache.jmeter.util.JMeterUtils; * or globally. * @since 1.X */ -public class IterationCounter extends AbstractFunction { +public class IterationCounter extends AbstractFunction implements ThreadListener { private static final List<String> desc = new LinkedList<>(); @@ -98,4 +99,14 @@ public class IterationCounter extends AbstractFunction { public List<String> getArgumentDesc() { return desc; } + + @Override + public void threadStarted() { + // Nothing to do on thread start + } + + @Override + public void threadFinished() { + perThreadInt.remove(); + } }
