What do you actually use for this method lockInterruptibly
? I have read the API however it's not very clear to me. Could anybody express it in other words?
lockInterruptibly()
may block if the the lock is already held by another thread and will wait until the lock is aquired. This is the same as with regular lock()
. But if another thread interrupts the waiting thread lockInterruptibly()
will throw InterruptedException
.