RFR: 8255074: sun.nio.fs.WindowsPath::getPathForWin32Calls synchronizes on String object

Igor Ignatyev iignatyev at openjdk.java.net
Wed Oct 21 02:40:10 UTC 2020


On Wed, 21 Oct 2020 00:02:46 GMT, Brian Burkhalter <bpb 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
>
> Marked as reviewed by bpb (Reviewer).

Thanks, Brian.

-------------

PR: https://git.openjdk.java.net/jdk/pull/774


More information about the nio-dev mailing list