title: Pausing std::thread until a function finishes
body: <pre><code>class Class {
  public:
      Class ();
  private:
      std::thread* updationThread;
  };
  </code></pre>
  
  <p>Constructor:</p>
  
  <pre><code>Class::Class() {
      updationThread = new std::thread(&amp;someFunc);
  }
  </code></pre>
  
  <p>At some point in my application, I have to pause that thread and call a function and after execution of that function I have to resume the thread. Let's say it happens here:</p>
  
  <pre><code>void Class::aFunction() {
       functionToBeCalled(); //Before this, the thread should be paused
       //Now, the thread should be resumed.
  }
  </code></pre>
  
  <p>I have tried to use another thread with function <code>functionToBeCalled()</code> and use <code>thread::join</code> but was unable to do that for some reason.</p>
  
  <p>How can I pause a thread or how can I use <code>thread::join</code> to pause a thread until the other finishes?</p>