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