activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1074285 - /activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java
Date Thu, 24 Feb 2011 20:12:13 GMT
Author: tabish
Date: Thu Feb 24 20:12:13 2011
New Revision: 1074285

URL: http://svn.apache.org/viewvc?rev=1074285&view=rev
Log:
apply fix for: https://issues.apache.org/jira/browse/AMQ-3187

Modified:
    activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java

Modified: activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java?rev=1074285&r1=1074284&r2=1074285&view=diff
==============================================================================
--- activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java
(original)
+++ activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java
Thu Feb 24 20:12:13 2011
@@ -160,7 +160,9 @@ public class JmsConsumerClient extends A
             public void onMessage(Message msg) {
                 incThroughput();
                 recvCount.incrementAndGet();
-                recvCount.notify();
+                synchronized (recvCount) {
+                    recvCount.notify();
+                }
             }
         });
 
@@ -169,7 +171,9 @@ public class JmsConsumerClient extends A
             LOG.info("Starting to asynchronously receive " + client.getRecvCount() + " messages...");
             try {
                 while (recvCount.get() < count) {
-                    recvCount.wait();
+                    synchronized (recvCount) {
+                        recvCount.wait();
+                    }
                 }
             } catch (InterruptedException e) {
                 throw new JMSException("JMS consumer thread wait has been interrupted. Message:
" + e.getMessage());



Mime
View raw message