This commit is contained in:
@@ -28,14 +28,11 @@ public class MessageProducers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public MessageProducer getProducer(MessageRecord message) {
|
public MessageProducer getProducer(MessageRecord message) {
|
||||||
int hash = message.hash();
|
int hash = index.incrementAndGet();
|
||||||
if (hash == 0) {
|
if (index.get() > 1000 * producers.length) {
|
||||||
hash = index.incrementAndGet();
|
synchronized (index) {
|
||||||
if (index.get() > 1000 * producers.length) {
|
if (index.get() > 1000 * producers.length) {
|
||||||
synchronized (index) {
|
index.addAndGet(-1000 * producers.length);
|
||||||
if (index.get() > 1000 * producers.length) {
|
|
||||||
index.addAndGet(-1000 * producers.length);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user