title: AtomicXXX.lazySet(...) in terms of happens before edges
body: <p>What does mean AtomicXXX.lazySet(value) method in terms of happens-before edges, used in most of JMM reasoning? The javadocs is pure on it, and Sun bug <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6275329" rel="noreferrer">6275329</a> states:</p>
  
  <blockquote>
    <p>The semantics are that the write is guaranteed not to be re-ordered with any previous write, but may be reordered with subsequent operations (or equivalently, might not be visible to other threads) until some other volatile write or synchronizing action occurs).</p>
  </blockquote>
  
  <p>But this not a reasoning about HB edges, so it confuses me. Does it mean what lazySet() semantics can't be expressed in terms of HB edges?  </p>
  
  <p><strong>UPDATE</strong>: I'll try to concretize my question. I can use ordinary volatile field in following scenario:</p>
  
  <pre><code>//thread 1: producer
  ...fill some data structure
  myVolatileFlag = 1;
  
  //thread 2: consumer
  while(myVolatileFlag!=1){
     //spin-wait
  }
  ...use data structure...
  </code></pre>
  
  <p>In this scenario use of "data structure" in consumer is correct, since volatile flag write-read make HB edge, giving guarantee what all writes to "data structure" by producer will be completed, and visible by consumer. But what if I'll use AtomicInteger.lazySet/get instead of volatile write/read in this scenario?</p>
  
  <pre><code>//thread 1: producer
  ...fill some data structure
  myAtomicFlag.lazySet(1);
  
  //thread 2: consumer
  while(myAtomicFlag.get()!=1){
     //spin-wait
  }
  ...use data structure...
  </code></pre>
  
  <p>will it be still correct? Can I still really on "data structure" values visibility in consumer thread?</p>
  
  <p>It is not "from air" question -- I've seen such method in LMAX Disruptor code in exactly this scenario, and I don't understand how to prove it is correct...</p>