Are you sure the RelayedMessages-0000000001 stream will receive a notification? This is normal when other threads are blocked, since the first thread still gets the lock for <0x12a8f9f8>. In order for other threads to obtain a lock, the first thread must be removed from the waiting list and scheduled to restart, and then release the lock it received.
There may be other threads waiting for the same object as the first thread, and when you report that these threads are selected for waking up. If possible, be sure to use notifyAll ().
It may also be possible to release the lock before putting the thread on the wait list or call wait by specifying a timeout value. it doesn't make sense that the thread has been on the waiting list for 16 hours. If you can also post other topics that will also be helpful.
Update:
You are right, I should have taken into account Thread.State. As you commented, it is not in a waiting state since it has been notified. Being on a waitlist is not a reason for not releasing the lock <0x12a8f9f8>. However, it is in a locked state. This means that he is trying to get the lock that he acquired before the object. Wait, but this is not possible. So it seems that there is another thread (not on the list you provided), blocking it.
I think you think that object.wait should have released the lock <0x12a8f9f8>. But object.wait only releases the lock on this object monitor and retains the other locks. And I think lock <0x12a8f9f8> is not a lock for an object monitor (for which a wait is called)
This may not be true, of course, and it can really be a mistake. I'm just trying to find possible reasons.
source share