This will break the api. Its fixed in master already but should not
get touched in 3

Sent from my iPhone. Excuse any typos....

Am 09.08.2012 um 01:12 schrieb Cruz Bishop notifications@github.com:

> As noted by a TODO note in line 505 (branch: 3)
> 
> ```
> public void cancel() {
>     if (!state.compareAndSet(ST_INIT, ST_CANCELLED)) {
>         // TODO return false
>         return;
>     }
> 
>     wheel[stopIndex].remove(this);
> }
> ```
> 
> I'll make a pull request to fix this in a moment
> 
> —
> Reply to this email directly or view it on GitHub.

HashedWheelTimer.cancel() cannot report failure
As noted by a TODO note in line 505 (branch: 3)

```
    public void cancel() {
        if (!state.compareAndSet(ST_INIT, ST_CANCELLED)) {
            // TODO return false
            return;
        }

        wheel[stopIndex].remove(this);
    }
```

I'll make a pull request to fix this in a moment

src/main/java/org/jboss/netty/util/HashedWheelTimer.java src/main/java/org/jboss/netty/util/Timeout.java
src/main/java/org/jboss/netty/util/HashedWheelTimer.java src/main/java/org/jboss/netty/util/Timeout.java
diff --git a/src/main/java/org/jboss/netty/util/HashedWheelTimer.java b/src/main/java/org/jboss/netty/util/HashedWheelTimer.java
index 3b8d1d2ae22..fad43274e9a 100644
--- a/src/main/java/org/jboss/netty/util/HashedWheelTimer.java
+++ b/src/main/java/org/jboss/netty/util/HashedWheelTimer.java
@@ -500,13 +500,13 @@ public TimerTask getTask() {
             return task;
         }
 
-        public void cancel() {
+        public boolean cancel() {
             if (!state.compareAndSet(ST_INIT, ST_CANCELLED)) {
-                // TODO return false
-                return;
+                return false;
             }
 
             wheel[stopIndex].remove(this);
+            return true;
         }
 
         public boolean isCancelled() {
diff --git a/src/main/java/org/jboss/netty/util/Timeout.java b/src/main/java/org/jboss/netty/util/Timeout.java
index 162eff87375..bf3ce154ec6 100644
--- a/src/main/java/org/jboss/netty/util/Timeout.java
+++ b/src/main/java/org/jboss/netty/util/Timeout.java
@@ -44,9 +44,11 @@ public interface Timeout {
     boolean isCancelled();
 
     /**
-     * Cancels the {@link TimerTask} associated with this handle.  It the
-     * task has been executed or cancelled already, it will return with no
-     * side effect.
+     * Attempts to cancel the {@link TimerTask} associated with this handle.
+     * If the task has been executed or cancelled already, it will return with
+     * no side effect.
+     *
+     * @return True if the cancellation completed successfully, otherwise false
      */
-    void cancel();
+    boolean cancel();
 }
