Quantcast
Channel: LabWindows/CVI topics
Viewing all articles
Browse latest Browse all 5361

Pass a variable to CmtScheduleThreadPoolFunction

$
0
0

Hi,

Take a look to the code below...

 

 

BOOL BVariableCopied;

void main (int argc, char *argv[])

{

int a = 0;

 

   while (TRUE) {

      BVariableCopied = FALSE;
      CmtScheduleThreadPoolFunction (DEFAULT_THREAD_POOL_HANDLE, ThreadFunction, &a, NULL);

      while (!BVariableCopied ) {

         Delay (0,01);

         }

   a++;

}

 

int CVICALLBACK ThreadFunction(void *data)
{
int a = *(int*)data;

 BVariableCopied = TRUE; 

......

 return TRUE;
}

 

 

There's a mode to keep the code more effient end elegant ? I would not to use the while/delay to wait for the ThreadFunction calling.

Thanks for your precious support

Tavella fabrizio

Micro Systems S.p.A.


Viewing all articles
Browse latest Browse all 5361

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>