diff --git a/templates/normal/experiment.cpp b/templates/normal/experiment.cpp index 2ad4dea..93cbf7f 100644 --- a/templates/normal/experiment.cpp +++ b/templates/normal/experiment.cpp @@ -137,12 +137,14 @@ static void TaskStarter() auto hyperperiod = calculate_hyperperiod(); + /* Initialize deadlines for every task */ + embb::mtapi::ExecutionPolicy deadline_policy[taskset_length]; for(int i = 0; i < taskset_length; i++) { node.CreateAction(ACTION_ID + i + 1, IdleTask); + deadline_policy[i] = embb::mtapi::ExecutionPolicy(embb_time_base(taskset[i].deadline)); } using namespace std::chrono; - start = base_clock::now(); std::cerr << "Starting TaskStarter thread at: "; @@ -173,7 +175,6 @@ static void TaskStarter() } if(count > taskset[i].count) { - embb::mtapi::ExecutionPolicy deadline_policy(embb_time_base(taskset[i].deadline)); /* Store parameters for execution. * The count may change during the execution, therefore we have * to make sure that all possible running tasks can access their