Possible Duplicate:
How to simulate constructor race conditions?
How to demonstrate race conditions around values that aren't published properly?
I got the following code from 《java concurrency in practice》:
public class Holder{
private int n;
public Holder(int n){this.n = n;}
public void assertSanity(){
if(n != n) throw new AssertionError("This statement is false.");
}
}
I am just wondering the condition n != n
, is this could be true under a certain circumstance?