On Fri, 20 Jun 2025 18:55:30 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:
> I mean that there's a _happens before_ relation each time the synchronized > block is reach whereas with volatile, the _happens before_ relation is > guaranteed only when the value of the variable changes. I do not think that this is true "guaranteed only when the value of the variable changes". >A write to a volatile field >([ยง8.3.1.4](https://docs.oracle.com/javase/specs/jls/se14/html/jls-8.html#jls-8.3.1.4)) > happens-before every subsequent read of that field. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25818#discussion_r2159607617