In the document of Reader.read() it says
Reads a single character. This method will block until a character is available, an I/O error occurs, or the end of the stream is reached.
When read() doesn’t get anything from the stream, it will block. However, this kind of “blocking” doesn’t turn the thread into State.BLOCKED or State.WAITING — the thread is still in State.RUNNABLE when read() waits for the first character, thus I can’t know if the thread is blocked by a read().
So how can I know if Reader.read() is blocking in a thread from another thread?
You can get a stack trace for the Thread and see which method it is running at that point.
Or what I do is set a time when the read starts which is clearer when the read finishes. I have another thread which checks this time and issues a warning when it has been too long.