RFR: 8255074: sun.nio.fs.WindowsPath::getPathForWin32Calls synchronizes on String object
Alan Bateman
alanb at openjdk.java.net
Wed Oct 21 05:41:08 UTC 2020
On Tue, 20 Oct 2020 21:50:38 GMT, Igor Ignatyev <iignatyev at openjdk.org> wrote:
> Hi all,
>
> could you please review this small and trivial patch?
>
> from JBS:
> `sun.nio.fs.WindowsPath::getPathForWin32Calls` synchronizes on `path` field, which is a `String` object:
> if (type != WindowsPathType.DRIVE_RELATIVE) {
> synchronized (path) {
> pathForWin32Calls = new WeakReference<String>(resolved);
> }
> }
> this might lead to a deadlock, synchronizing on `this` is appropriate here.
>
> testing:
> * [x] tier1
> * [x] `test/jdk/java/nio` on windows-x64
Looks like a typo in the original code.
Let's fix the description in the JBS before pushing this.
-------------
PR: https://git.openjdk.java.net/jdk/pull/774
More information about the nio-dev
mailing list