* Slight code clean up
* Raised the default cancelled key clean up interval from 128 to 256
This commit is contained in:
parent
b105461383
commit
cdf1474059
@ -361,7 +361,7 @@ class NioDatagramWorker implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean cleanUpCancelledKeys() throws IOException {
|
private boolean cleanUpCancelledKeys() throws IOException {
|
||||||
if (cancelledKeys >= 128) { // FIXME hardcoded value
|
if (cancelledKeys >= NioWorker.CLEANUP_INTERVAL) {
|
||||||
cancelledKeys = 0;
|
cancelledKeys = 0;
|
||||||
selector.selectNow();
|
selector.selectNow();
|
||||||
return true;
|
return true;
|
||||||
|
@ -65,6 +65,8 @@ class NioWorker implements Runnable {
|
|||||||
|
|
||||||
private static final int CONSTRAINT_LEVEL = NioProviderMetadata.CONSTRAINT_LEVEL;
|
private static final int CONSTRAINT_LEVEL = NioProviderMetadata.CONSTRAINT_LEVEL;
|
||||||
|
|
||||||
|
static final int CLEANUP_INTERVAL = 256; // XXX Hard-coded value, but won't need customization.
|
||||||
|
|
||||||
private final int bossId;
|
private final int bossId;
|
||||||
private final int id;
|
private final int id;
|
||||||
private final Executor executor;
|
private final Executor executor;
|
||||||
@ -292,7 +294,7 @@ class NioWorker implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean cleanUpCancelledKeys() throws IOException {
|
private boolean cleanUpCancelledKeys() throws IOException {
|
||||||
if (cancelledKeys >= 128) { // FIXME hardcoded value
|
if (cancelledKeys >= CLEANUP_INTERVAL) {
|
||||||
cancelledKeys = 0;
|
cancelledKeys = 0;
|
||||||
selector.selectNow();
|
selector.selectNow();
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user