RFR: 8291061: Improve thread safety of FileTime.toString and toInstant

Andrey Turbanov aturbanov at openjdk.org
Tue Jul 26 20:39:31 UTC 2022


We need to read fields `instant`/`valueAsString` once, as to dodge/resolve the data race on reading lazily-initialized fields.

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

Commit messages:
 - [PATCH] Improve thread safety of FileTime.toString and toInstant

Changes: https://git.openjdk.org/jdk/pull/9608/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9608&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8291061
  Stats: 6 lines in 1 file changed: 5 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/9608.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/9608/head:pull/9608

PR: https://git.openjdk.org/jdk/pull/9608


More information about the nio-dev mailing list