JDK 9 RFR of 8152085: (ch) RandomAccessFile.getChannel().lock() is uninterruptible

Brian Burkhalter brian.burkhalter at oracle.com
Thu Jan 26 20:37:44 UTC 2017


Please review at your convenience.

Issue:	https://bugs.openjdk.java.net/browse/JDK-8152085
Patch:	http://cr.openjdk.java.net/~bpb/8152085/webrev.00/

On Windows, when a file is locked by one process via a FileChannel, and a second process attempts a blocking lock on the same file via a FileChannel, then the thread blocking on the lock call cannot be interrupted. This patch fixes the problem by replacing the blocking lock call with polling a non-blocking lock call. I am not at all sure that this is a good solution, so should someone else have a better idea about it that they would like to share I would be happy to read it.

Thanks,

Brian


More information about the nio-dev mailing list