5

Consider the following Java\Tomcat thread dump:

"http-0.0.0.0-4080-4" daemon prio=10 tid=0x0000000019a2b000 nid=0x360e in Object.wait() [0x0000000040b71000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00002ab5565fe358> (a org.apache.tomcat.util.net.JIoEndpoint$Worker)
    at java.lang.Object.wait(Object.java:485)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.await(JIoEndpoint.java:458)
    - locked <0x00002ab5565fe358> (a org.apache.tomcat.util.net.JIoEndpoint$Worker)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:484)
    at java.lang.Thread.run(Thread.java:662)

Is this a deadlock? It seems that the same resource (0x00002ab5565fe358) is both locked and waited on - what does it mean?

Adam Matan
  • 128,757
  • 147
  • 397
  • 562

1 Answers1

4

Its more like an infinite wait(). It would have said something like id1 is BLOCKED on monitor owned by id2

clinton
  • 612
  • 3
  • 6
  • OK I took a look at the source for JIoEndpoint.Worker. It is as I thought the await() method at line 453 is synchronized and there is an open call to it in the run() method at line 484. – clinton Oct 21 '12 at 18:24
  • Could you please elaborate your answer and add a solution so I can accept it? – Adam Matan Oct 22 '12 at 03:57