14 #include "../mythreads.h"
26 struct ScheduleThreadData
29 volatile bool shutdown;
35 , myScheduleEventSubscriber (NULL)
40 static ScheduleThreadData S_scheduleThreadData;
42 static void* ScheduleThreadWorkerFunction(
void* pThreadData )
44 const ScheduleThreadData* pScheduleThreadData = (ScheduleThreadData*)pThreadData;
48 while( !error && !pScheduleThreadData->shutdown ) {
49 FunctionResult fr = pScheduleThreadData->pDcaInstance->schedule( pScheduleThreadData->myScheduleEventSubscriber );
56 for (
size_t k=0; k<60 && !pScheduleThreadData->shutdown; ++k)
65 static pthread_t S_hScheduleThread = 0;
69 S_scheduleThreadData.pDcaInstance = &aDcaInstance;
70 S_scheduleThreadData.myScheduleEventSubscriber = pSubscriber;
72 pthread_create(&S_hScheduleThread, NULL, ScheduleThreadWorkerFunction, (
void*)&S_scheduleThreadData);
77 S_scheduleThreadData.shutdown =
true;
78 pthread_join(S_hScheduleThread, NULL);