title: onSpinWait​() method of Thread class - Java 9
body: <p>While learning Java 9 features I came across a new method of <code>Thread</code> class, called <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Thread.html#onSpinWait--" rel="noreferrer"><code>onSpinWait​</code></a>. As per javadocs, this method is used for this:</p>
  
  <blockquote>
    <p>Indicates that the caller is momentarily unable to progress, until the
    occurrence of one or more actions on the part of other activities.</p>
  </blockquote>
  
  <p>Can someone help me understand this method giving a real-life example or scenario?</p>