Calculate the 80% the right way. See #327

This commit is contained in:
norman 2012-09-03 08:58:33 +02:00
parent f87bd9fd81
commit a61403de53
2 changed files with 2 additions and 2 deletions

View File

@ -254,7 +254,7 @@ abstract class AbstractNioWorker implements Worker {
Selector selector = this.selector;
// use 80% of the timeout for measure
final long minSelectTimeout = SelectorUtil.SELECT_TIMEOUT_NANOS / 100 * 80;
final long minSelectTimeout = SelectorUtil.SELECT_TIMEOUT_NANOS * 80 / 100;
boolean wakenupFromLoop = false;
for (;;) {
wakenUp.set(false);

View File

@ -245,7 +245,7 @@ class NioClientSocketPipelineSink extends AbstractNioChannelSink {
long lastConnectTimeoutCheckTimeNanos = System.nanoTime();
// use 80% of the timeout for measure
final long minSelectTimeout = SelectorUtil.SELECT_TIMEOUT_NANOS / 100 * 80;
final long minSelectTimeout = SelectorUtil.SELECT_TIMEOUT_NANOS * 80 / 100;
boolean wakenupFromLoop = false;
for (;;) {
wakenUp.set(false);