Skip to content

Commit aa43210

Browse files
committed
Make lastXXX fields volatile
1 parent bfdf9df commit aa43210

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/main/java/org/elasticsearch/common/util/concurrent/TaskExecutionTimeTrackingEsThreadPoolExecutor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public final class TaskExecutionTimeTrackingEsThreadPoolExecutor extends EsThrea
3333
private final boolean trackOngoingTasks;
3434
// The set of currently running tasks and the timestamp of when they started execution in the Executor.
3535
private final Map<Runnable, Long> ongoingTasks = new ConcurrentHashMap<>();
36-
private long lastPollTime = System.nanoTime();
37-
private long lastTotalExecutionTime = 0;
36+
private volatile long lastPollTime = System.nanoTime();
37+
private volatile long lastTotalExecutionTime = 0;
3838

3939
TaskExecutionTimeTrackingEsThreadPoolExecutor(
4040
String name,

0 commit comments

Comments
 (0)