gettting a wait()'ing thread to run again
- From: Rajarshi Guha <rajarshi@xxxxxxxxxxxxxx>
- Date: Sat, 29 Apr 2006 18:39:13 -0400
Hi, I have some code running which consists of a GUI. At one point, a long
running task must be executed. So the code looks like:
// some code
// progress monitor code
longTask.go()
// do something with the results of long task
The problem is, that the code that calls longTask.go() must wait for
longTask to finish. I created long task based on the examples for the
ProgressMonitor class on the Java website. However the difference is that
I must wait till the thread that longTask is in finishes.
So I modified it to:
// some code
// progress monitor code
longTask.go()
try {
this.wait()
} catch(..) {}
// do stuff with the results of long task
However, what I don't understand is how I can get the current thread (ie
the one that is waiting) to start running again once longTask has
completed.
I hope I've been able to describe the problem as I'm a newbie to threads.
Any pointers would be appreciated
Thanks,
Rajarshi
.
- Prev by Date: Re: JTextPane - get location of selected text
- Next by Date: Re: How to implement tab order?
- Previous by thread: Custom JFrame Header
- Next by thread: Need time waster code or something.
- Index(es):