title: Golang sleep thread instead of busy waiting
body: <p>I am writing a Go implementation of <a href="https://en.wikipedia.org/wiki/Lamport%27s_bakery_algorithm" rel="nofollow noreferrer">Leslie Lamport's Bakery algorithm</a>, which has busy-spin-waits to handle some maximum number of threads.</p>
  
  <hr>
  
  <p>I am writing a go function that should not proceed unless a special condition is met. My code so far looks like this:</p>
  
  <pre><code>func acquireLock() {
      ...
      for specialConditionIsFalse {
      }
      ...
  }
  </code></pre>
  
  <p>Is there a more efficient way to stop proceeding with this thread?</p>