title: C++ threads: How do I stop two different functions from being called at the same time?
body: <p>I'm new to c++ threads and I'm currently using boost for threading. I am trying to figure out how to stop two functions from being called at the same time.</p>
  
  <pre><code>void function1(){
     //some task
  
  
  }
  
  void function2(){
     //some other task
  
  
  }
   //both tasks can not run at the same time
  </code></pre>
  
  <p>how would I stop function 1 and function 2 from running at the same time?</p>