On Mar 21, 2006, at 10:42 AM, Joseph J. Strout wrote:

At 7:38 AM -0800 3/21/06, Jay Rimalrick wrote:

I want to do something, but only after a specific
thread is finished.  Is there a way to detect exactly
when a thread finishes (from outside of the thread)?

Sure -- have your thread set some public property on itself as the last thing it does in its Run event.

Or, if you prefer, check the .State property, which will be 4 (Thread.NotRunning) when the thread has finished.

But these approaches don't really answer his question, which is a way to detect when a thread finishes. This seems to be a trickier problem. One way is to use a Timer to check the State property from time to time. Or perhaps one could do some trick with a semaphore so that one thread is blocked until the specific thread releases the semaphore.

--------------
Charles Yeomans

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to