mirror of https://github.com/apache/activemq.git
apply fix for: https://issues.apache.org/jira/browse/AMQ-3187
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1074285 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6595dc4a62
commit
d245457ccd
|
@ -160,7 +160,9 @@ public class JmsConsumerClient extends AbstractJmsMeasurableClient {
|
|||
public void onMessage(Message msg) {
|
||||
incThroughput();
|
||||
recvCount.incrementAndGet();
|
||||
recvCount.notify();
|
||||
synchronized (recvCount) {
|
||||
recvCount.notify();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -169,7 +171,9 @@ public class JmsConsumerClient extends AbstractJmsMeasurableClient {
|
|||
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());
|
||||
|
|
Loading…
Reference in New Issue