From 33a1d2088e3ee52a2e5477a11dbb6484324b741a Mon Sep 17 00:00:00 2001 From: Tobias Langer Date: Tue, 11 Oct 2016 21:25:40 +0200 Subject: [PATCH] Create deadlinepolicy before hand. --- templates/normal/experiment.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 -- libgit2 0.26.0