title: Unlock on ReentrantLock without IllegalMonitorStateException
body: <p>I have a piece of code (simplified):</p>
  
  <pre><code>if(reentrantLockObject.isLocked()) {
         reentrantLockObject.unlock();
  }
  </code></pre>
  
  <p>where reentrantLockObject is java.util.concurrent.locks.ReentrantLock. 
  Sometimes I get IllegalMonitorStateException.
  It seams that lock was released between check and unlock() call. 
  How can I prevent this exception? </p>