From bf34af7bc1a5aaa0379fd0d65d2180ce88f2e377 Mon Sep 17 00:00:00 2001 From: mdb Date: Fri, 20 Oct 2006 04:04:59 +0000 Subject: [PATCH] This should be synchronized as we're going to read this value from another thread. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1954 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/util/Invoker.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/java/com/samskivert/util/Invoker.java b/src/java/com/samskivert/util/Invoker.java index 7c7fac3d..0e787ddf 100644 --- a/src/java/com/samskivert/util/Invoker.java +++ b/src/java/com/samskivert/util/Invoker.java @@ -122,7 +122,9 @@ public class Invoker extends LoopingThread if (PERF_TRACK) { // record the time spent on the queue as a special unit start = System.currentTimeMillis(); - _unitsRun++; + synchronized (this) { + _unitsRun++; + } // record the time spent on the queue as a special unit recordMetrics("queue_wait_time", start - unit.queueStamp); }