8202252: (aio) Closed AsynchronousSocketChannel keeps completion handler alive
roger.riggs at oracle.com
Mon Jul 2 15:41:54 UTC 2018
On 7/2/18 11:05 AM, Alan Bateman wrote:
> On 27/06/2018 19:12, Brian Burkhalter wrote:
>> On Jun 27, 2018, at 8:25 AM, Alan Bateman <Alan.Bateman at oracle.com
>> <mailto:Alan.Bateman at oracle.com>> wrote:
>>> The change to set connectHandler to null needs more checking, I
>>> can't immediately say if this if right.
>> The only lines in the (new) code where connectHandler is used are:
>> 340: set connectHandler instance variable from parameter passed in
>> 275:assign a local variable ‘handler’ from connectHandler instance
>> 276: set connectHandler to null
>> Updated: http://cr.openjdk.java.net/~bpb/8202252/webrev.01/
> This looks better but shouldn't the weak reference to be handler
> rather than obj? Also if the System.gc is moved to the
> waitForRefToClear then it will allow you to remove the lengthy
A bit tidier would be to create a ReferenceQueue so the WeakReference is
enqueued when it is ready.
Then the test can just wait on it to be enqueued, no sleeping required.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nio-dev