I've been going through Java Concurrency in Practice and trying to reproduce the examples as I go through.
I found that when trying to illustrate the no visibility problem in chapter 3 the example in the code didn't work for me so I tweaked it a little bit:
Here is the test:
Then after running it for some time:
org.junit.ComparisonFailure:
Expected :0
Actual :-1822446613
\o/
I found that when trying to illustrate the no visibility problem in chapter 3 the example in the code didn't work for me so I tweaked it a little bit:
Here is the test:
Then after running it for some time:
org.junit.ComparisonFailure:
Expected :0
Actual :-1822446613
\o/