0rph3u
05/09/2018, 8:50 PMgroostav
05/10/2018, 12:43 AMmutex
, will see the value that thread B just wrote, having acquired and released the lock. Practically however this code might be perfectly fine, but given an evil CPU that only promises the bare minimum of the jvm memory model, you might see not correct values for count
groostav
05/10/2018, 12:55 AM