为什么 Thread.interrupt() 不能中断试图获取锁的线程

Why can't Thread.interrupt() interrupt a thread trying to acquire lock

Thinking in Java一书中写到Thread.interrupt()不能打断正在尝试获取同步锁的线程,我想知道为什么?

阻塞操作只有在声明抛出时才能被中断InterruptedException。显然,synchronized 块没有声明它,因此不可能在线程等待获取锁时中断它。

或者,您可以使用显式锁并调用 Lock.lockInterruptibly()

这本书是错误的,除非它只提到 synchronized 关键字。 Object.wait() 抛出 InterruptedException.