The original resolution must be false.
When an interrupt is caught, you need to interrupt the current thread again
catch (InterruptedException e) { th.interrupt(); }
because if park() returns due to an interrupt, the interrupt status must be set (see javadoc example)
After wait() , usually or abruptly due to an interrupt, use permission.
In unpark() , if the resolution is already true, there is no need to notify.
source share