A blocking operation can only be interrupted if a throw InterruptedException declared. It is clear that the synchronized block does not announce this, so it is not possible to interrupt a thread while it is waiting for a lock.
Alternatively, you can use explicit locking and calling Lock.lockInterruptibly() .
source share