How can one Java thread check the state of another one, e.g. whether the other one is blocked?

Viewed 7875

This is a question asked to one of my friends during an interview.

How do you know whether a thread is blocked inside a synchronized method, from another thread?

Can anybody please explain this using an example?

4 Answers
Related