To close. Step 2 is atomic. In this case, j must be one of byte , char , short or int , and each of them can be loaded and saved atomically.
Once the value has been loaded into the hardware register, it should not be possible for another thread to interfere with it. There is probably something in JLS about the atomicity of primitive operations ... but I cannot notice it.
source share