title: How to know if a Python multiprocessing.Lock is released or not?
body: <pre><code>&gt;&gt;&gt; l = Lock()
  &gt;&gt;&gt; l.acquire()
  True
  &gt;&gt;&gt; l.release()
  &gt;&gt;&gt; l.release()
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  ValueError: semaphore or lock released too many times
  </code></pre>
  
  <p>throws a ValueError exception. How can I prevent to release a lock more than once? Something like l.is_released() ?</p>