11-11-2016 09:29 AM
TestStand is getting hung up at the end of my test. I'm trying to kick off a new test thread. All that thread does is call the TestFunction() in my c++ dll. I have another function that is called in my main test that is using a function in the same dll called StopTestFunction(). When StopTestFunction is run it sets a global variable to false which should cause the thread to finish since TestFunction() will finish. Once TestStand gets through the test it simply gets hung up at the end and I have to kill the application with task manager. Am I doing something wrong when I create the test thread? I attached an image of the sequence and some code with the functions mentioned above.
Solved! Go to Solution.
11-11-2016
05:49 PM
- last edited on
10-28-2024
05:26 PM
by
Content Cleaner
I see two reasons this is happening:
while (doListen = true)This is an assignment operation, so this will always be true and this loop will never stop. Comparison would be:
while (doListen == true)
while (doListen == true) { number ++; }This is counting as fast as possible in a loop and will not stop to process other events.
If you're wanting to run something continuously in the background and stop it from a different thread in TestStand, I recommend two things:
Hope this helps,
Trent
11-14-2016 08:35 AM
Thanks for catching the missing ''==" I didn't even realize that I did that. I will try using a sync object and or Termination Monitor. I havn't had to use those before, thank you.