title: Is mutex compatible with pthread in C++11?
body: <p>Despite <code>pthread_mutex</code>, would mutex (<code>#include &lt;mutex&gt;</code>) make pthread safe using C++11?</p>
  
  <p>Please find down an example:</p>
  
  <pre><code>// Creating Server thread
  pthread_create(&amp;server_thread, NULL,Server,NULL);
  
  // Creating Client thread
  pthread_create(&amp;client_thread, NULL, Client,NULL);
  
  // Wait until client_thread exits
  pthread_join( client_thread, NULL);
  </code></pre>
  
  <p>both Server, and Client call <code>foo()</code>.</p>
  
  <pre><code>mutex mut;
  void foo (){
       mut.lock();
       CRITICAL_WRITE();
       mut.unlock();
  }
  </code></pre>