title: How to detect deadlock ? Timeout in synchronized block?
body: <p>I’m debugging a Java application that runs several threads. After a while of watching the log it seems that one of those threads is not running anymore. My guess is that the thread is waiting for a lock that is never released (the last output is before calling a synchronized method).</p>
  
  <p>Can I configure a timeout to the thread; a sort of  “wait for this lock but if it not available after 10 seconds don’t wait anymore!”</p>