title: How to freeze a thread and notify it from another?
body: <p>I need to pause the current thread in Rust and notify it from another thread. In Java I would write:</p>
  
  <pre class="lang-java prettyprint-override"><code>synchronized(myThread) {
      myThread.wait();
  }
  </code></pre>
  
  <p>and from the second thread (to resume main thread):</p>
  
  <pre class="lang-java prettyprint-override"><code>synchronized(myThread){
      myThread.notify();
  }
  </code></pre>
  
  <p>Is is possible to do the same in Rust?</p>