title: static lock_guard with static mutex too?
body: <p>So I've some thread-unsafe function call which I need to make thread safe so I'm trying to use a <code>std::mutex</code> and a <code>std::lock_guard</code>. Currently code looks like this -</p>
  
  <pre><code>int myFunc(int value){
      static std::mutex m;
      std::lock_guard lock(m);
      auto a = unsafe_call(value);
      return a;
  }
  </code></pre>
  
  <p>the <code>unsafe_call()</code> being the thread-unsafe function. I've also put static around the mutex because then the function will have different mutexes for each separate call.</p>
  
  <p>What I want to know is, should I also make <code>lock_guard</code> static because the mutex is static one, as I was told by some coworker of mine. I don't see a reason why should I do this, because I consider <code>lock_guard</code> to be a simple <code>.lock()</code> and <code>.unlock()</code> call, but the suggestion from coworker is confusing me.</p>