<div>I actually realized what you intended to say. Could you review my fix:<div><br></div><div> https://github.com/netty/netty/commit/dbb239203460253f84b0f848b8f05e3b6e11a2fd</div><div><br></div><div>Cheers</div></div>
<div><br>-- <br><a href="http://gleamynode.net/">Trustin Lee</a><br></div>
<p style="color: #A0A0A8;">On Friday, August 12, 2011 at 1:46 PM, Trustin Lee wrote:</p>
<blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
<span><div><div>Hi Ron,<br><br>I like the alternative 2. However, could you explain why the public<br>methods in HashedWheelTimeout should be synchronized? Is there<br>anything thread-unsafe there?<br><br>Thanks<br><br>On Tue, Aug 9, 2011 at 4:54 PM, <<a href="mailto:rzo@gmx.de">rzo@gmx.de</a>> wrote:<br><blockquote type="cite"><div>Hello,<br><br>given that the implementation is using "approximated times" a call to Timeout.cancel() may not cancel the task.<br><br>I think that the problem is:<br><br>public void cancel() {<br> if (isExpired()) {<br> return;<br> }<br><br><br>where isExpired checks:<br><br>System.currentTimeMillis() > deadline<br><br>Solution:<br>Alternative 1:<br><br>remove the check:<br><br>if (isExpired()) {<br> return;<br> }<br><br>Alternative 2:<br><br>new field:<br><br>boolean expired = false.<br><br>this is set to true in:<br><br>HashedWheelTimeout.expire()<br><br>and isExpired()<br>{<br> return canceled || expired;<br>}<br><br><br>I also propose that the public methods on HashedWheelTimeout be synchronized.<br><br>What do you think ?<br><br>-- Ron<br><a href="http://sourceforge.net/projects/yajsw">http://sourceforge.net/projects/yajsw</a><br>--<br>NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!<br>Jetzt informieren: <a href="http://www.gmx.net/de/go/freephone">http://www.gmx.net/de/go/freephone</a><br>_______________________________________________<br>netty-users mailing list<br><a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/netty-users">https://lists.jboss.org/mailman/listinfo/netty-users</a><br></div></blockquote><br><br><br>-- <br>Trustin Lee, <a href="http://gleamynode.net">http://gleamynode.net</a>/<br></div></div></span>
</blockquote>
<div>
<br>
</div>