Utility.inNativeImage
This commit is contained in:
@@ -41,8 +41,6 @@ public abstract class ClientConnection<R extends ClientRequest, P extends Client
|
|||||||
|
|
||||||
protected final LongAdder doneResponseCounter = new LongAdder();
|
protected final LongAdder doneResponseCounter = new LongAdder();
|
||||||
|
|
||||||
protected final AtomicBoolean writePending = new AtomicBoolean();
|
|
||||||
|
|
||||||
protected final ReentrantLock writeLock = new ReentrantLock();
|
protected final ReentrantLock writeLock = new ReentrantLock();
|
||||||
|
|
||||||
protected final ByteArray writeArray = new ByteArray();
|
protected final ByteArray writeArray = new ByteArray();
|
||||||
@@ -61,7 +59,6 @@ public abstract class ClientConnection<R extends ClientRequest, P extends Client
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void failed(Throwable exc, ClientConnection attachment) {
|
public void failed(Throwable exc, ClientConnection attachment) {
|
||||||
writePending.set(false);
|
|
||||||
attachment.dispose(exc);
|
attachment.dispose(exc);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -530,7 +530,7 @@ public abstract class Sncp {
|
|||||||
}
|
}
|
||||||
newDynName += "_" + (normal ? name : hash(name));
|
newDynName += "_" + (normal ? name : hash(name));
|
||||||
}
|
}
|
||||||
if (methodBoost == null) { // 加强动态时不能重复加载
|
if (Utility.inNativeImage() || methodBoost == null) { // 加强动态时不能重复加载
|
||||||
try {
|
try {
|
||||||
final String newDynClass = newDynName.replace('/', '.');
|
final String newDynClass = newDynName.replace('/', '.');
|
||||||
Class clz = RedkaleClassLoader.findDynClass(newDynClass);
|
Class clz = RedkaleClassLoader.findDynClass(newDynClass);
|
||||||
|
|||||||
@@ -398,6 +398,10 @@ public final class Utility {
|
|||||||
return CPUS;
|
return CPUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean inNativeImage() {
|
||||||
|
return NATIVE_IMAGE_ENV;
|
||||||
|
}
|
||||||
|
|
||||||
public static Function<String, ExecutorService> virtualExecutorFunction() {
|
public static Function<String, ExecutorService> virtualExecutorFunction() {
|
||||||
return virtualPoolFunction;
|
return virtualPoolFunction;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user