aspose file tools
The moose likes Threads and Synchronization and the fly likes awake a thread! Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "awake a thread!" Watch "awake a thread!" New topic
Author

awake a thread!

eric sato
Ranch Hand

Joined: Oct 01, 2002
Posts: 37
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


If you can't change the direction the the wind, change your sail.
J Kneeland
Ranch Hand

Joined: Aug 15, 2004
Posts: 31
From inside of it or outside?

You could always just interrupt it.

Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
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.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: awake a thread!
 
Similar Threads
notify
New to Struts
Thread wakes (get lock) without notify() or notifyAll()
New to Struts
notify and notify all