Thread.wait() hangs
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Raj_Zutshi
Posted On:   Tuesday, January 20, 2004 08:18 AM

Hi,

I am using Object.wait() on the Thread object, inside a synchronized block like this -

class myclass{
...
someMethod(){
...
synchronized(this){
...
Thread currentThrd = Thread.currentThread();
synchronized(currentThrd){
currentThrd.wait();
}
}
}

The jvm hangs on the wait call. Can anyone explain this ?

Thanks,
Raj

Re: Thread.wait() hangs

Posted By:   Simon_Ablett  
Posted On:   Tuesday, January 20, 2004 08:22 AM

I would say that this is probably to do with your synchronisation. You are syncing on the current object and then on the 'currentThrd' object. I could be wrong but this doesn't look right to me. What are you hoping to achieve?

Regards.
About | Sitemap | Contact