RFR: 8255074: sun.nio.fs.WindowsPath::getPathForWin32Calls synchronizes on String object
Brian Burkhalter
bpb at openjdk.java.net
Wed Oct 21 00:05:10 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:
> * [ ] tier1
> * [x] `test/jdk/java/nio` on windows-x64
Marked as reviewed by bpb (Reviewer).
-------------
PR: https://git.openjdk.java.net/jdk/pull/774
More information about the nio-dev
mailing list