From activemq-commits-return-1975-apmail-geronimo-activemq-commits-archive=geronimo.apache.org@geronimo.apache.org Mon Jun 05 07:37:11 2006 Return-Path: Delivered-To: apmail-geronimo-activemq-commits-archive@www.apache.org Received: (qmail 50699 invoked from network); 5 Jun 2006 07:37:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Jun 2006 07:37:10 -0000 Received: (qmail 47225 invoked by uid 500); 5 Jun 2006 07:37:10 -0000 Delivered-To: apmail-geronimo-activemq-commits-archive@geronimo.apache.org Received: (qmail 47213 invoked by uid 500); 5 Jun 2006 07:37:10 -0000 Mailing-List: contact activemq-commits-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-dev@geronimo.apache.org Delivered-To: mailing list activemq-commits@geronimo.apache.org Received: (qmail 47201 invoked by uid 99); 5 Jun 2006 07:37:10 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jun 2006 00:37:10 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jun 2006 00:37:09 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id AA4F81A983E; Mon, 5 Jun 2006 00:36:49 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r411701 - /incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfMeasurementTool.java Date: Mon, 05 Jun 2006 07:36:49 -0000 To: activemq-commits@geronimo.apache.org From: aco@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060605073649.AA4F81A983E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: aco Date: Mon Jun 5 00:36:48 2006 New Revision: 411701 URL: http://svn.apache.org/viewvc?rev=411701&view=rev Log: Add synchronization block. Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfMeasurementTool.java Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfMeasurementTool.java URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfMeasurementTool.java?rev=411701&r1=411700&r2=411701&view=diff ============================================================================== --- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfMeasurementTool.java (original) +++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfMeasurementTool.java Mon Jun 5 00:36:48 2006 @@ -129,7 +129,10 @@ // Compute for the actual duration window of the sampler long endTime = System.currentTimeMillis() + duration - rampDownTime; try { - Thread.sleep(rampUpTime); + try { + Thread.sleep(rampUpTime); + } catch (InterruptedException e) { + } // Let's reset the throughput first and start getting the samples for (Iterator i=perfClients.iterator(); i.hasNext();) { @@ -138,14 +141,18 @@ } while (System.currentTimeMillis() < endTime && !stop.get()) { - Thread.sleep(interval); + try { + Thread.sleep(interval); + } catch (InterruptedException e) { + } sampleClients(); sampleIndex++; } - } catch (InterruptedException e) { } finally { isRunning.set(false); - isRunning.notifyAll(); + synchronized (isRunning) { + isRunning.notifyAll(); + } } } @@ -161,7 +168,9 @@ public void waitForSamplerToFinish(long timeout) { while (isRunning.get()) { try { - isRunning.wait(timeout); + synchronized (isRunning) { + isRunning.wait(timeout); + } } catch (InterruptedException e) { } }