title: Lock Mutex but don't wait for it to be unlocked
body: <p>How would I lock a <code>std::mutex</code> or <code>boost::mutex</code> so at the start of my method I would lock it, but regardless of it already being locked or not just proceed with the code. </p>
  
  <p>I want this kind of behaviour because there is going to be 2 threads that'll be reading and writing to an <code>std::map</code>. When it's reading I just want to lock the mutex so that it can continue reading but the writing stops. When it's writing I want it to lock another mutex, which'll block reading and writing, and wait for both mutexes to be unlocked so that it can work with the map alone.</p>