Having this wait declaration:
public final native void wait(long timeout) throws InterruptedException;
It could exit by InterruptedExceptio
You can't differentiate between the two unless you provide some additional code. For example by adding a ThreadLocal Boolean that is set to true only on notify()
ThreadLocal
Boolean
true
notify()
But first you must make sure your logic requires this differentiation.