Java memory model: volatile variables and happens-before
i = 1 always happens-before v = 2 True. By JLS section 17.4.5, If x and y are actions of the same thread and x comes before y in program order, then hb(x, y). v = 2 happens-before vDst = v in JMM only if it’s actually happens before in time i = 1 happens-before … Read more