Hi, I use a thread to receive CAN msg like code below:
int CVICALLBACK DataAcqThreadFunction (void *functionData);
int main(int argc, char *argv[])
{
int panelHandle;
int functionId;
DisplayPanel (panelHandle);
CmtScheduleThreadPoolFunction (DEFAULT_THREAD_POOL_HANDLE, DataAcqThreadFunction, NULL, &functionId);
RunUserInterface ();
DiscardPanel (panelHandle);
return 0;
}
int CVICALLBACK DataAcqThreadFunction (void *functionData)
{
while (!quit) {
ncWaitForState(...)
...
}
return 0;
}
the code works fine but i need to close the thread, unfortunately the thread is locked in ncWaitforstate so i can not terminate it until i receive at least one msg.
Have you some idea to implement a receive method in a new thread without polling type?
thanks
marco