Author: ataylor
Date: 2011-09-14 08:29:51 -0400 (Wed, 14 Sep 2011)
New Revision: 11348
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
Log:
https://issues.jboss.org/browse/JBPAPP-5747
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java 2011-09-14
08:04:17 UTC (rev 11347)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java 2011-09-14
12:29:51 UTC (rev 11348)
@@ -798,7 +798,10 @@
public void addConsumer(final ClientConsumerInternal consumer)
{
- consumers.put(consumer.getID(), consumer);
+ synchronized (consumers)
+ {
+ consumers.put(consumer.getID(), consumer);
+ }
}
public void addProducer(final ClientProducerInternal producer)
@@ -808,7 +811,10 @@
public void removeConsumer(final ClientConsumerInternal consumer) throws
HornetQException
{
- consumers.remove(consumer.getID());
+ synchronized (consumers)
+ {
+ consumers.remove(consumer.getID());
+ }
}
public void removeProducer(final ClientProducerInternal producer)
@@ -1899,9 +1905,12 @@
private void flushAcks() throws HornetQException
{
- for (ClientConsumerInternal consumer : consumers.values())
+ synchronized (consumers)
{
- consumer.flushAcks();
+ for (ClientConsumerInternal consumer : consumers.values())
+ {
+ consumer.flushAcks();
+ }
}
}