#include "pmacros.h" #include "system.h" #include #include #include #include #include #include #include #include #include #include "returncode.h" #include "benchmark.h" #include "monano.h" #include "monano_data.h" #include "measure.h" #include "time_conversion.h" #include "task_parameter.h" #include "nthread.h" struct pthread_monano_t my_monano; pthread_monano_id_t my_monano_id[NTHREAD]; struct pthread_monano_attr_t tparam[CONFIGURE_MAXIMUM_MONANO_THREAD_NUMBER]; struct periodic_activation_parameters* param_active; void* POSIX_Init(void *argument){ int status, i; int thread_number; struct timespec measure_ts_start; struct sched_param param; struct pthread_monano_attr_t* task_param; /* Monano init and register */ for(i=0; ipriority; tparam[i].period=task_param->period; tparam[i].wcet=task_param->wcet; tparam[i].deadline=task_param->deadline; /* create a monano periodic thread */ param_active = (struct periodic_activation_parameters*)malloc(sizeof(struct periodic_activation_parameters)); if (param_active == NULL){ printf("ERREUR MALLOC init.c"); exit(0); } benchmark_periodic_activation_parameter_init(param_active); param_active->ego=i; param_active->non_preemptive=1; if (my_monano.nb_precedencies!=0){ for(int j=0;j< my_monano.nb_precedencies; j++) if (param_active->ego == my_monano.pthread_precedencies[j].destination) param_active->precedency_blocking=1; } status=pthread_monano_periodic_thread_create (&my_monano, tparam[i], benchmark_periodic_activation, &my_monano_id[i], param_active); if(status<0){ returncode("pthread_monano_pthread_periodic_create",status); } task_param++; } nanosleep(&stop,NULL); pthread_monano_stop(&my_monano); exit(0); return NULL; }