
When is a thread complete?
Hi Ed,
The frame does not know when the thread is complete.
If the frame has to do somethign when the thread is finished, then as a last
dying act <g> the thread should POST and event (Event:user say) back to the
frame. ie
Post(Event:User,,1)
Note the 2 commas (since it's not going to any specific control) and I've
hard-coded the frame to thread 1. Probably not great. A better thing would
be;
a) create global _non threaded_ varible called Mainthread.
b) In init of Frame put MainThread = Thread()
c) in other proc put Post (Event:User,,MainThread)
d) in TakeEvent of Frame put
if event() = Event:User
! other thread just finished...
end
Lastly...
Quote:
> What is the main frame doing while another thread is running?
It's stll going. It's probably sitting on the ACCEPT command wating for
events to process...
Cheers
Bruce
Quote:
> I'm sure this question has a simple answer, but I'm tired of beating my
head
> against the wall so I'll ask it.
> When I start a thread from the frame, how can I tell when it has
completed?
> I need to perform some logic when the thread is done but I don't know
where
> or how to do this.
> What is the main frame doing while another thread is running?
> Any help would be greatly appreciated.
> Thanks - Ed Campbell
> Using C5b - Abc