title: scoped_lock doesn't work on file?
body: <p>According to the link below, I wrote a small test case. But it doesn't work. Any idea is appreciated!</p>
  
  <p>Reference:
  <a href="http://www.cppprog.com/boost_doc/doc/html/interprocess/synchronization_mechanisms.html#interprocess.synchronization_mechanisms.file_lock.file_lock_careful_iostream" rel="noreferrer">http://www.cppprog.com/boost_doc/doc/html/interprocess/synchronization_mechanisms.html#interprocess.synchronization_mechanisms.file_lock.file_lock_careful_iostream</a></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  
  #include &lt;boost/interprocess/sync/file_lock.hpp&gt;
  #include &lt;boost/interprocess/sync/scoped_lock.hpp&gt;
  
  using namespace std; 
  using namespace boost::interprocess;
  
  int main()
  {
      ofstream file_out("fileLock.txt");
      file_lock f_lock("fileLock.txt");
  
      {
          scoped_lock&lt;file_lock&gt; e_lock(f_lock);  // it works if I comment this out
          file_out &lt;&lt; 10;
          file_out.flush();
          file_out.close();
      }
  
      return 0;
  }
  </code></pre>