JDK 9 RFR of 8152085: (ch) RandomAccessFile.getChannel().lock() is uninterruptible
brian.burkhalter at oracle.com
Thu Jan 26 20:37:44 UTC 2017
Please review at your convenience.
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.
More information about the nio-dev