title: python conditional lock
body: <p>How can I implement conditional lock in threaded application, for instance I haw 
  30 threads that are calling function and for most off the time all threads can access is simultaneous, but depending on function input there can be condition when only one thread can do that one thing. (If value for input is repeated and some thread is still working then I need lock.)</p>
  
  <p>I now that there is module threading with Rlock() but I don't now how to use it in a way that i described it in first part.</p>
  
  <p><strong>Edit</strong>: The question is actually about how to prevent any two threads from running the same function with the same argument at the same time. (Thanks to David for helping me formulate my question :) )</p>