• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using of wait(long milliseconds) method , to make a Thread wait

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dude, why don't you try writing some code and executing it.
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!