[jboss-cvs] JBoss Messaging SVN: r4324 - trunk/examples/jms/src/org/jboss/jms/example.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed May 28 11:33:07 EDT 2008


Author: jmesnil
Date: 2008-05-28 11:33:06 -0400 (Wed, 28 May 2008)
New Revision: 4324

Modified:
   trunk/examples/jms/src/org/jboss/jms/example/PerfExample.java
Log:
the 3rd time is the charm...

Modified: trunk/examples/jms/src/org/jboss/jms/example/PerfExample.java
===================================================================
--- trunk/examples/jms/src/org/jboss/jms/example/PerfExample.java	2008-05-28 15:06:48 UTC (rev 4323)
+++ trunk/examples/jms/src/org/jboss/jms/example/PerfExample.java	2008-05-28 15:33:06 UTC (rev 4324)
@@ -236,6 +236,7 @@
       {
          this.countDownLatch = countDownLatch;
          this.perfParams = perfParams;
+         warmingUp = perfParams.getNoOfWarmupMessages() > 0;
       }
 
       public void onMessage(Message message)
@@ -245,7 +246,7 @@
             if (warmingUp)
             {
                boolean committed = checkCommit();
-               if (messageCount.longValue() == perfParams.getNoOfWarmupMessages())
+               if (messageCount.incrementAndGet() == perfParams.getNoOfWarmupMessages())
                {
                   log.info("warmed up after receiving " + messageCount.longValue() + " msgs");
                   if (!committed)
@@ -255,8 +256,6 @@
                   warmingUp = false;
                   // reset messageCount to take stats
                   messageCount.set(0);
-               } else {
-                  messageCount.incrementAndGet();
                }
                return;
             }




More information about the jboss-cvs-commits mailing list