Let's say I have a variable x (of type myClass ) that is initially null and some assignment
x = myObject
happens exactly once in some background thread.
Is it guaranteed that x always contains either null or myObject when accessing from the main thread? Or is it possible that x contains some invalid data in the near future?
Heinzi
source share