From 07e0bf9413d08a29ab1a865a16381ede7ded8b82 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Tue, 19 Aug 2008 10:21:04 +0000 Subject: [PATCH] Removed unused code in DefaultChannelFuture --- .../netty/channel/DefaultChannelFuture.java | 44 ++----------------- 1 file changed, 3 insertions(+), 41 deletions(-) diff --git a/src/main/java/org/jboss/netty/channel/DefaultChannelFuture.java b/src/main/java/org/jboss/netty/channel/DefaultChannelFuture.java index da4817fb07..daa0a35f35 100644 --- a/src/main/java/org/jboss/netty/channel/DefaultChannelFuture.java +++ b/src/main/java/org/jboss/netty/channel/DefaultChannelFuture.java @@ -42,7 +42,6 @@ public class DefaultChannelFuture implements ChannelFuture { private static final InternalLogger logger = InternalLoggerFactory.getInstance(DefaultChannelFuture.class); - private static final int DEAD_LOCK_CHECK_INTERVAL = 5000; private static final Throwable CANCELLED = new Throwable(); private final Channel channel; @@ -142,8 +141,7 @@ public class DefaultChannelFuture implements ChannelFuture { while (!done) { waiters++; try { - this.wait(DEAD_LOCK_CHECK_INTERVAL); - checkDeadLock(); + this.wait(); } finally { waiters--; } @@ -166,14 +164,11 @@ public class DefaultChannelFuture implements ChannelFuture { while (!done) { waiters++; try { - this.wait(DEAD_LOCK_CHECK_INTERVAL); + this.wait(); } catch (InterruptedException e) { // Ignore. } finally { waiters--; - if (!done) { - checkDeadLock(); - } } } } @@ -208,7 +203,7 @@ public class DefaultChannelFuture implements ChannelFuture { try { for (;;) { try { - this.wait(Math.min(waitTime, DEAD_LOCK_CHECK_INTERVAL)); + this.wait(waitTime); } catch (InterruptedException e) { if (interruptable) { throw e; @@ -227,42 +222,10 @@ public class DefaultChannelFuture implements ChannelFuture { } } finally { waiters--; - if (!done) { - checkDeadLock(); - } } } } - private void checkDeadLock() { -// IllegalStateException e = new IllegalStateException( -// "DEAD LOCK: " + ChannelFuture.class.getSimpleName() + -// ".await() was invoked from an I/O processor thread. " + -// "Please use " + ChannelFutureListener.class.getSimpleName() + -// " or configure a proper thread model alternatively."); -// -// StackTraceElement[] stackTrace = e.getStackTrace(); -// -// // Simple and quick check. -// for (StackTraceElement s: stackTrace) { -// if (AbstractPollingIoProcessor.class.getName().equals(s.getClassName())) { -// throw e; -// } -// } -// -// // And then more precisely. -// for (StackTraceElement s: stackTrace) { -// try { -// Class cls = DefaultChannelFuture.class.getClassLoader().loadClass(s.getClassName()); -// if (IoProcessor.class.isAssignableFrom(cls)) { -// throw e; -// } -// } catch (Exception cnfe) { -// // Ignore -// } -// } - } - public void setSuccess() { synchronized (this) { // Allow only once. @@ -332,7 +295,6 @@ public class DefaultChannelFuture implements ChannelFuture { } otherListeners = null; } - } }