title: C++ mutex in namespace std does not name a type
body: <p>I'm writing a simple C++ program to demonstrate the use of locks. I am using <code>codeblocks</code> and <code>gnu</code> <code>gcc</code> compiler.</p>
  
  <pre><code> #include &lt;iostream&gt;
   #include &lt;thread&gt;
   #include &lt;mutex&gt;
   using namespace std;
   int x = 0; // shared variable
  
   void synchronized_procedure()
   {
      static std::mutex m;
      m.lock();
      x = x + 1;
      if (x &lt; 5)
      {
         cout&lt;&lt;"hello";
      }
      m.unlock();
  
   }
  
  int main()
  {
  
     synchronized_procedure();
     x=x+2;
     cout&lt;&lt;"x is"&lt;&lt;x;
  }
  </code></pre>
  
  <p>I'm getting the following error: <code>mutex in namespace std does not name a type</code>.</p>
  
  <p>Why am I getting this error?
  Doesn't the compiler support use of locks?</p>