I know that compound operations such as i++ are not thread safe as they involve multiple operations.
i++
But is checking the reference with itself a t
Proved with test-ng:
public class MyTest { private static Integer count=1; @Test(threadPoolSize = 1000, invocationCount=10000) public void test(){ count = new Integer(new Random().nextInt()); Assert.assertFalse(count != count); } }
I have 2 fails on 10 000 invocations. So NO, it is NOT thread safe