You can stop using CmtTerminateThreadPoolThread. Killing threads through this method is extremely risky and should only be used in extreme circumstances like an unresponsive thread or system shutdown. As it warns you on the function panel for this function, all sorts of hangs can be caused by killing threads since you have no idea what they are doing when you kill them. For example, if your thread is killed while accessing the hard drive or a GPIB device, you could lock out those resources causing hangs such as you are seeing.
You should shutdown your threads by signaling the thread with a flag or a message to shutdown and letting it exit its function normally. This is true in all multithreaded programming, not just in CVI. Killing threads is a risky th
ing to do, and should only be done in extreme circumstances.
Best Regards,
Chris Matthews
National Instruments