10-13-2010 03:04 PM
How do I close a new thread after starting a sequence in a parallel new thread?
I know I can store the new thread object reference on creation but don't know how to release the thread.
10-13-2010 10:11 PM
Hi,
You are using the sequence call step to launch a sequence in a new thread? You could just let the sequence run to the end and it will close all by itself. If there is a loop in the sequence then you could send it a message to exit and let it close itself. Use a Que or poll a StationGlobal or pass a property as a parameter to poll. You could use an api method on the stored object reference, sorry I don't have TestStand right here to look at it, but you probably would use Thread class methods and properties. Usually this would be abort or something non-graceful like that. I think the best way is to tell the thread to exit and let it jump to its own cleanup and exit itself. You can use a Wait step that will wait on the thread to exit if needed.
cc
10-14-2010 01:46 AM
Set the obj to Nothing
eg
Locals.SeqObj = Nothing