[jboss-cvs] JBoss Messaging SVN: r3873 - branches/Branch_Stable/src/main/org/jboss/jms/server/endpoint.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Mar 12 17:36:34 EDT 2008
Author: timfox
Date: 2008-03-12 17:36:34 -0400 (Wed, 12 Mar 2008)
New Revision: 3873
Modified:
branches/Branch_Stable/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
Log:
http://jira.jboss.org/jira/browse/JBMESSAGING-1245
Modified: branches/Branch_Stable/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java 2008-03-12 13:09:58 UTC (rev 3872)
+++ branches/Branch_Stable/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java 2008-03-12 21:36:34 UTC (rev 3873)
@@ -111,6 +111,11 @@
private int prefetchSize;
+ private int sendCount;
+
+ private boolean firstTime = true;
+
+
// Constructors ---------------------------------------------------------------------------------
ServerConsumerEndpoint(String id, Queue messageQueue, String queueName,
@@ -123,7 +128,7 @@
{
log.trace("constructing consumer endpoint " + id);
}
-
+
this.id = id;
this.messageQueue = messageQueue;
@@ -331,11 +336,7 @@
return delivery;
}
}
-
- private volatile int sendCount;
-
- private boolean firstTime = true;
-
+
// Filter implementation ------------------------------------------------------------------------
public boolean accept(Message msg)
@@ -405,15 +406,18 @@
try
{
- if (newRate > 0)
- {
- sendCount = 0;
- clientAccepting = true;
- }
- else
- {
- clientAccepting = false;
- }
+ synchronized (startStopLock)
+ {
+ if (newRate > 0)
+ {
+ sendCount = 0;
+ clientAccepting = true;
+ }
+ else
+ {
+ clientAccepting = false;
+ }
+ }
if (clientAccepting)
{
More information about the jboss-cvs-commits
mailing list