more work on nio event loop
This commit is contained in:
parent
98d0a34c88
commit
1873883284
2 changed files with 1 additions and 6 deletions
|
@ -136,11 +136,9 @@ public final class NioEventLoop extends SingleThreadEventLoop {
|
|||
} catch (IOException e) {
|
||||
throw new EventLoopException("failed to open a new selector", e);
|
||||
}
|
||||
|
||||
if (DISABLE_KEY_SET_OPTIMIZATION) {
|
||||
return new SelectorTuple(unwrappedSelector);
|
||||
}
|
||||
|
||||
Class<?> maybeSelectorImplClass = null;
|
||||
try {
|
||||
maybeSelectorImplClass = Class.forName("sun.nio.ch.SelectorImpl", false,
|
||||
|
@ -148,7 +146,6 @@ public final class NioEventLoop extends SingleThreadEventLoop {
|
|||
} catch (ClassNotFoundException e) {
|
||||
//
|
||||
}
|
||||
|
||||
// ensure the current selector implementation is what we can instrument.
|
||||
if (maybeSelectorImplClass == null || !maybeSelectorImplClass.isAssignableFrom(unwrappedSelector.getClass())) {
|
||||
return new SelectorTuple(unwrappedSelector);
|
||||
|
@ -751,7 +748,7 @@ public final class NioEventLoop extends SingleThreadEventLoop {
|
|||
private static boolean isExplicitTryReflectionSetAccessible() {
|
||||
// we disable reflective access
|
||||
boolean defaultValue = javaVersion() < 9 || System.getProperties().containsKey("org.graalvm.nativeimage.imagecode");
|
||||
return Boolean.parseBoolean(System.getProperties().getProperty("io.netty.tryReflectionSetAccessible",
|
||||
return Boolean.parseBoolean(System.getProperties().getProperty("org.xbib.tryReflectionSetAccessible",
|
||||
Boolean.toString(defaultValue)));
|
||||
}
|
||||
|
||||
|
|
|
@ -20,12 +20,10 @@ final class SelectedSelectionKeySet extends AbstractSet<SelectionKey> {
|
|||
if (o == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
keys[size++] = o;
|
||||
if (size == keys.length) {
|
||||
increaseCapacity();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue