title: How lock by method parameter?
body: <pre><code>string Get(string key){
     lock(_sync){
      //   DoSomething
     }
  }
  </code></pre>
  
  <p>If DoSomething depend only on key, I want key dependent lock. I think it may be dictionary with sync objects. Is there any complete solution?</p>
  
  <p>Something like real example
  <a href="https://stackoverflow.com/questions/39112/what-is-the-best-way-to-lock-cache-in-asp-net/3135475#3135475">What is the best way to lock cache in asp.net?</a></p>