In the code below will read1 be always equal to read2, provided property Flag can be changed from other threads? Concern here is that
read1
read2
Flag
if Flag can be changed from other threads, there is no guarantee that read1 and read2 will be the same. You would have to use a monitor/mutex surrounding your code and also make sure that the Flag setter also respects that mutex.