Hi,
I wrote a program that open a second thread and while it runs the main thread to something else... the main thread does not exit until the second thread returns.
it looks something like that:
void DLLEXPORT myFunctionName(char* scriptName, tTestData* testData)
{
....
CmtScheduleThreadPoolFunction(DEFAULT_THREAD_POOL_HANDLE,
newThread,
(void*) command,NULL);
while(flag)
{
....
}
}
the function of the thread is:
int CVICALLBACK newThread(void *functionData)
{
printf("here\n");
command = (char*)functionData;
flag= TRUE;
...
flag= FALSE;
}
my problem is that when I call this function from testStand it runs fine for a few time and after a while the second thread will not open anymore until I'll exit testStand completely
after reopenning testStand it will run fine again for a few times...
when I say that the secondary thread is not openning - it doesn't print the first line and doesn't return an error code value.
if anyone have any ideas...
thanks,
Noa