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()
But first you must make sure your logic requires this differentiation.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…