> 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)?

I create a "stack" of "things to be done" that's checked during idle time
(triggered by a timer). At each check, the oldest thing on the stack gets
pulled off and depending on what it is, something gets done. The rest of the
stack stays intact until the next check.

Then, simply have your thread add a "things to be done" item to the stack as
the last thing it does. I do this a lot, particularly when I'm setting a
series of controls in the window and don't want the window to be refreshed
until the last control has been set.

The stack is simply a numeric array, each entry has a number that tells my
application what needs doing. The array is enlarged each time something is
added, with new things going at the top (higher end) of it. Each time
something is pulled off the bottom of it, the items above it are moved down
and the array size shrinks by one.

- John McKernon


_______________________________________________
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