title: Poco ScopedLock in a loop
body: <p>Say I have something like this:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;Poco/Mutex.h&gt;
  
  Poco::FastMutex mutex;
  
  int main()
  {
      for(int i = 0; i &lt; 10; ++i)
      {
          Poco::FastMutex::ScopedLock lock(mutex);
  
          // do some stuff...
      }
  
      return 0;
  };
  </code></pre>
  
  <p>Will the mutex be acquired on every iteration or only once? If I want to protect the whole loop, would it be better to move it outside, like this?</p>
  
  <pre><code>{
      Poco::FastMutex::ScopedLock lock(mutex);
  
      for(int i = 0; i &lt; 10; ++i)
      {
  
          // do some stuff...
      }
  
      return 0;
  }
  </code></pre>