[9] RFR: 8164159: java/nio/file/WatchService/UpdateInterference.java test leaves daemon threads
Alan Bateman
Alan.Bateman at oracle.com
Thu Aug 18 19:42:49 UTC 2016
On 18/08/2016 18:19, Artem Smotrakov wrote:
>
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8164159
>> Webrev: http://cr.openjdk.java.net/~asmotrak/8164159/webrev.00/
The comment in the finally block is confusing. It says that threads will
stop before the WatchService is closed but it's the other way around -
the WatchService::close method will be invoked before the finally block
executes. This means that ClosedWatchServiceException will likely br
thrown and the stack trace recorded in the test output.
A minor suggestion, can Thread one and two be renamed to t1 and t2 to
make it a bit more readable? Also no need to initialize to volatile stop
to false as that is its initial value.
-Alan.
More information about the nio-dev
mailing list