fix support concurrency

This commit is contained in:
ylz
2024-06-13 17:42:52 +08:00
parent b431718ee6
commit f9a2a397ad

View File

@@ -457,11 +457,13 @@ public final class DbleServer {
}
public NIOProcessor nextFrontProcessor() {
int i = ++nextFrontProcessor;
if (i >= frontProcessors.length) {
i = nextFrontProcessor = 0;
synchronized (this) {
int i = ++nextFrontProcessor;
if (i >= frontProcessors.length) {
i = nextFrontProcessor = 0;
}
return frontProcessors[i];
}
return frontProcessors[i];
}
public NIOProcessor nextBackendProcessor() {