title: What is the best way to realize a synchronization barrier between threads
body: <p>Having several threads running I need to guaranty that every of my threads reached a certain point before proceeding. I need to implement a kind of barrier. Consider a function <code>func</code> which can be run from several threads:</p>
  
  <pre><code>void func()
  {
    operation1();
    // wait till all threads reached this point 
    operation2();
  }
  </code></pre>
  
  <p>What is best way to realise this barrier using C++ 11 and VS12, considering boost if needed.</p>