added yield back into dispatch() - but with a counter - so not so much of a performance hog

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@478238 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2006-11-22 16:59:26 +00:00
parent e34cbc1b07
commit e78a6f7ee9
1 changed files with 5 additions and 0 deletions

View File

@ -106,6 +106,7 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC
private int rollbackCounter = 0;
private long redeliveryDelay = 0;
private int ackCounter = 0;
private int dispatchedCount = 0;
private MessageListener messageListener;
private JMSConsumerStatsImpl stats;
@ -877,6 +878,10 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC
}
}
}
if (++dispatchedCount%1000==0) {
dispatchedCount=0;
Thread.yield();
}
} catch (Exception e) {
session.connection.onAsyncException(e);
}