From f18044bfe523d460f06953e7ede7cf07d4d7b44c Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Tue, 15 Sep 2026 15:36:27 -0400 Subject: [PATCH] fix thread safety --- .../main/java/org/jlab/utils/benchmark/BenchmarkTimer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common-tools/clas-utils/src/main/java/org/jlab/utils/benchmark/BenchmarkTimer.java b/common-tools/clas-utils/src/main/java/org/jlab/utils/benchmark/BenchmarkTimer.java index 8092d63024..3d3ed4abaf 100644 --- a/common-tools/clas-utils/src/main/java/org/jlab/utils/benchmark/BenchmarkTimer.java +++ b/common-tools/clas-utils/src/main/java/org/jlab/utils/benchmark/BenchmarkTimer.java @@ -1,7 +1,7 @@ package org.jlab.utils.benchmark; import java.util.ArrayList; -import java.util.HashMap; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; @@ -12,8 +12,8 @@ public class BenchmarkTimer { public static class BenchmarkMultiTimer extends BenchmarkTimer { - HashMap timeAtResume = new HashMap<>(); - HashMap isPaused = new HashMap<>(); + ConcurrentHashMap timeAtResume = new ConcurrentHashMap<>(); + ConcurrentHashMap isPaused = new ConcurrentHashMap<>(); public BenchmarkMultiTimer(String name) { super(name); } public void resume(int thread) { if (!isPaused.containsKey(thread) || isPaused.get(thread)) {