diff options
| author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-08-01 02:46:37 -0400 |
|---|---|---|
| committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-08-01 02:46:37 -0400 |
| commit | 41884912179240ae4d22cf67984522d5225a7d26 (patch) | |
| tree | 8f1a47be4b88d1323eb3511ed7445cb4b3bacf05 | |
| parent | c84c35511dcc32262e12b8a4e99b4e678a433371 (diff) | |
Add a little explanation to the basic task prototypes
Also add the priority parameter, which was missing.
| -rw-r--r-- | bin/base_mt_task.c | 9 | ||||
| -rw-r--r-- | 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) | |||
| 133 | param.exec_cost = EXEC_COST * NS_PER_MS; | 133 | param.exec_cost = EXEC_COST * NS_PER_MS; |
| 134 | param.period = PERIOD * NS_PER_MS; | 134 | param.period = PERIOD * NS_PER_MS; |
| 135 | param.relative_deadline = RELATIVE_DEADLINE * NS_PER_MS; | 135 | param.relative_deadline = RELATIVE_DEADLINE * NS_PER_MS; |
| 136 | param.cls = RT_CLASS_SOFT; | 136 | |
| 137 | /* What to do in the case of budget overruns? */ | ||
| 137 | param.budget_policy = NO_ENFORCEMENT; | 138 | param.budget_policy = NO_ENFORCEMENT; |
| 138 | 139 | ||
| 140 | /* The task class parameter is ignored by most plugins. */ | ||
| 141 | param.cls = RT_CLASS_SOFT; | ||
| 142 | |||
| 143 | /* The priority parameter is only used by fixed-priority plugins. */ | ||
| 144 | param.priority = LITMUS_LOWEST_PRIORITY; | ||
| 145 | |||
| 139 | /* Make presence visible. */ | 146 | /* Make presence visible. */ |
| 140 | printf("RT Thread %d active.\n", ctx->id); | 147 | printf("RT Thread %d active.\n", ctx->id); |
| 141 | 148 | ||
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) | |||
| 73 | param.exec_cost = EXEC_COST * NS_PER_MS; | 73 | param.exec_cost = EXEC_COST * NS_PER_MS; |
| 74 | param.period = PERIOD * NS_PER_MS; | 74 | param.period = PERIOD * NS_PER_MS; |
| 75 | param.relative_deadline = RELATIVE_DEADLINE * NS_PER_MS; | 75 | param.relative_deadline = RELATIVE_DEADLINE * NS_PER_MS; |
| 76 | param.cls = RT_CLASS_SOFT; | 76 | |
| 77 | /* What to do in the case of budget overruns? */ | ||
| 77 | param.budget_policy = NO_ENFORCEMENT; | 78 | param.budget_policy = NO_ENFORCEMENT; |
| 78 | 79 | ||
| 79 | /* The task is in background mode upon startup. */ | 80 | /* The task class parameter is ignored by most plugins. */ |
| 81 | param.cls = RT_CLASS_SOFT; | ||
| 82 | |||
| 83 | /* The priority parameter is only used by fixed-priority plugins. */ | ||
| 84 | param.priority = LITMUS_LOWEST_PRIORITY; | ||
| 85 | |||
| 86 | /* The task is in background mode upon startup. */ | ||
| 80 | 87 | ||
| 81 | 88 | ||
| 82 | /***** | 89 | /***** |
| @@ -84,7 +91,7 @@ int main(int argc, char** argv) | |||
| 84 | */ | 91 | */ |
| 85 | 92 | ||
| 86 | 93 | ||
| 87 | 94 | ||
| 88 | /***** | 95 | /***** |
| 89 | * 2) Work environment (e.g., global data structures, file data, etc.) would | 96 | * 2) Work environment (e.g., global data structures, file data, etc.) would |
| 90 | * be setup here. | 97 | * be setup here. |
