Resources | Resources |



Example - create and schedule a callback

After creating thread 1, c_samplethread_launchthreads() calls CALLBACK_Init() to initialize a callback structure with the name of the callback function for thread 1, then calls ITHREAD_Join() to schedule the callback to be invoked when the thread terminates, as shown below:

   CALLBACK_Init( &pMe->cbTimeIsUp, (PFNNOTIFY)c_samplethread_thread1done,
            (void *)pMe );
   ITHREAD_Join(pMe->piThread1, &pMe->cbTimeIsUp, &pMe->nThread1Result);