Is this a deadlock ?

A

Albert

Hi, sudenly, my program doesn't exit any more. Using jstack i got this
stack trace:

"AWT-Shutdown" prio=10 tid=0x08394400 nid=0xd5a in Object.wait()
[0xb4dad000..0xb4daddc0]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x60065140> (a java.lang.Object)
at java.lang.Object.wait(Object.java:485)
at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259)
- locked <0x60065140> (a java.lang.Object)
at java.lang.Thread.run(Thread.java:619)

I see that the thread lock an object and then wait for it. Is this a
deadlock ?
 
M

markspace

Albert said:
I see that the thread lock an object and then wait for it. Is this a
deadlock ?


No, wait() releases the lock.

However it might be deadlock of another sort. If the thread that is
supposed to notify() that object is gone, stuck, or otherwise can't do
it's job, you're effectively dead locked.
 
D

Daniel Pitts

Albert said:
Hi, sudenly, my program doesn't exit any more. Using jstack i got this
stack trace:

"AWT-Shutdown" prio=10 tid=0x08394400 nid=0xd5a in Object.wait()
[0xb4dad000..0xb4daddc0]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x60065140> (a java.lang.Object)
at java.lang.Object.wait(Object.java:485)
at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259)
- locked <0x60065140> (a java.lang.Object)
at java.lang.Thread.run(Thread.java:619)

I see that the thread lock an object and then wait for it. Is this a
deadlock ?
Deadlock requires at least two threads. A deadlock is formed when there
is a cycle in the graph of threads waiting on other threads.

You have only shown one thread, so this is not a deadlock. Also, it is
the AWT-Shutdown thread, which is probably waiting on the EDT thread to
finish. It would probably be Okay for that thread to block forever.
 
A

Andreas Leitgeb

Roedy Green said:
I don't think so. All you have is a thread waiting for Godot.

So all you have to do is wait till this evening... or next one... ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,692
Latest member
JenniferTi

Latest Threads

Top