waiting for some asynchronous method to complete

W

Wolfgang

For diagnostic purposes I'm looking for a way to wait for the
completion of some asynchronous method. For example

//Do something here.
// Then do something asynchronous, that normally goes off in it's own
thread, e.g.:

Graphics.drawImage(...);

// or some other other asynchronous method whatever.

// Now I want to wait until the asynchronous method returns, before I
continue with the main thread of my program.

I understand the value of threading, but in some debugging scenarios
I'd rather be synchronous -- temporarily.

I know there are specialized tools for special cases, such as
MediaTracker. But isn't there a more general solution for this, for
all those cases that don't have special waiting tools?

Thanks for any help.

Wolfgang
 
C

Chris Uppal

Wolfgang said:
I understand the value of threading, but in some debugging scenarios
I'd rather be synchronous -- temporarily.

Why not just refrain from starting a Thread in these cases and call the run()
method directly ?

-- chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top