title: Unlocking lock owned by another thread java
body: <p>I have a LockManager that manages the locks of several threads. Sometimes the threads are bad boys, and I have to kill them and ask the LockManager to release all their locks. However, since I use ReentrantLock in java this is impossible, I can not unlock a lock owned by another thread.</p>
  
  <p>I am forced to use Locks (cannot use semaphores, it is point of the homework). Is there any Java Lock implementation that allows me to unlock locks owned by other threads?</p>
  
  <p>So far the options I considered are:</p>
  
  <ul>
  <li>re-implementing ReentrantLock in a way that allows me to do this</li>
  <li>Make some sort of mapping between Semaphores and ReentrantLocks</li>
  </ul>
  
  <p>Extra Sources you may find useful:</p>
  
  <ul>
  <li><a href="http://www.coderanch.com/t/431859/threads/java/Reentrant-locks-Unlocking-thread" rel="noreferrer">Reentrant locks - Unlocking from another thread</a></li>
  <li><a href="https://stackoverflow.com/questions/2196220/unlocking-a-lock-from-a-thread-which-doesnt-own-it-or-redesigning-to-avoid-thi/2228883#2228883">Unlocking a lock from a thread which doesn't own it, or redesigning to avoid this?</a></li>
  </ul>