From 41884912179240ae4d22cf67984522d5225a7d26 Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Wed, 1 Aug 2012 08:46:37 +0200 Subject: Add a little explanation to the basic task prototypes Also add the priority parameter, which was missing. --- bin/base_mt_task.c | 9 ++++++++- bin/base_task.c | 13 ++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/bin/base_mt_task.c b/bin/base_mt_task.c index 78446e3..8090cc3 100644 --- a/bin/base_mt_task.c +++ b/bin/base_mt_task.c @@ -133,9 +133,16 @@ void* rt_thread(void *tcontext) param.exec_cost = EXEC_COST * NS_PER_MS; param.period = PERIOD * NS_PER_MS; param.relative_deadline = RELATIVE_DEADLINE * NS_PER_MS; - param.cls = RT_CLASS_SOFT; + + /* What to do in the case of budget overruns? */ param.budget_policy = NO_ENFORCEMENT; + /* The task class parameter is ignored by most plugins. */ + param.cls = RT_CLASS_SOFT; + + /* The priority parameter is only used by fixed-priority plugins. */ + param.priority = LITMUS_LOWEST_PRIORITY; + /* Make presence visible. */ printf("RT Thread %d active.\n", ctx->id); diff --git a/bin/base_task.c b/bin/base_task.c index 8baf3c8..df0c5a2 100644 --- a/bin/base_task.c +++ b/bin/base_task.c @@ -73,10 +73,17 @@ int main(int argc, char** argv) param.exec_cost = EXEC_COST * NS_PER_MS; param.period = PERIOD * NS_PER_MS; param.relative_deadline = RELATIVE_DEADLINE * NS_PER_MS; - param.cls = RT_CLASS_SOFT; + + /* What to do in the case of budget overruns? */ param.budget_policy = NO_ENFORCEMENT; - /* The task is in background mode upon startup. */ + /* The task class parameter is ignored by most plugins. */ + param.cls = RT_CLASS_SOFT; + + /* The priority parameter is only used by fixed-priority plugins. */ + param.priority = LITMUS_LOWEST_PRIORITY; + + /* The task is in background mode upon startup. */ /***** @@ -84,7 +91,7 @@ int main(int argc, char** argv) */ - + /***** * 2) Work environment (e.g., global data structures, file data, etc.) would * be setup here. -- cgit v1.2.2