| Author |
Using of wait(long milliseconds) method , to make a Thread wait
|
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
Hi ,
If we use the wait(long milliseconds) option to make a Thread wait .
What happens to the Thread if the milliseconds specified has been completed ??
Does this Thread die after this seconds have been reached ??
Thanks .
|
Save India From Corruption - Anna Hazare.
|
 |
Jaikiran Pai
Marshal
Joined: Jul 20, 2005
Posts: 8142
|
|
|
Have you read http://download.oracle.com/javase/6/docs/api/java/lang/Object.html#wait%28long%29
|
[My Blog] [JavaRanch Journal]
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
It says that :
Causes the current thread to wait until either another thread invokes the notify() method or the notifyAll() method for this object, or a specified amount of time has elapsed.
My question is that what happens to the Thread when it has completed the timeout specified in wait method
Do you really know ??
|
 |
Sandeep Sanaboyina
Ranch Hand
Joined: Dec 14, 2009
Posts: 72
|
|
|
Dude, why don't you try writing some code and executing it.
|
They say you have to be the first, the best or different. I say, is it too much to ask for all three.
|
 |
Jaikiran Pai
Marshal
Joined: Jul 20, 2005
Posts: 8142
|
|
Ravi Kiran V wrote:It says that :
Causes the current thread to wait until either another thread invokes the notify() method or the notifyAll() method for this object, or a specified amount of time has elapsed.
And a lot more than that. Did you even read that entire documentation?
Ravi Kiran V wrote:
My question is that what happens to the Thread when it has completed the timeout specified in wait method
Read that documentation again, it has the answer.
|
 |
 |
|
|
subject: Using of wait(long milliseconds) method , to make a Thread wait
|
|
|