I was trying to create a few scenarios to demonstrate visibility issues while sharing variable across threads. And I noticed that in almost all the cases I tested, if inside
This behaviour is implementation specific. In OpenJDK, println's body is synchronized altough the API does not state that it is.
println