It is possible (though unlikely) that the stream just released the monitor when your stream dump was made. There may be a short period between when the monitor is released and the next thread will receive it. If you are not in a real dead end, this may explain what you see. Try another stream dump and check it out.
Most likely, there is a thread where the monitor is already located. Sometimes this is not obvious. The stack trace has some "locked" lines that list threads that contain certain locks, but this list is not necessarily complete. For example, I suspect that locks received through the JNI are not specified.
If you can replace the built-in lock, for example. java.util.concurrent.locks.ReentrantLock , you can pause the program and apply a debugger, find the lock you care about and find the owner of the lock using the getOwner method.
Keith randall
source share