• Post Reply Bookmark Topic Watch Topic
  • New Topic

awake a thread!

 
eric sato
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
Is there possible to awake a thread that being sleep??

eg.
MyThreadName.sleep(1000000);
Based on some logic, sometimes i would like to awake the MyThreadName at specific time secs.


If the question been posted, pls provide the url. Thanks anyway.
Kind regards,
KH
 
J Kneeland
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From inside of it or outside?

You could always just interrupt it.

 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From your mention of logic to decide when to wake it up I wondered if you might know the wakeup time before you go to sleep? If so,it's pretty easy to do something like this:

Or see Timer to make something happen at a specific time.

If you don't know the wake time before you sleep, that interrupt suggestion is perfect.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!