diff options
Diffstat (limited to 'bin/base_mt_task.c')
-rw-r--r-- | bin/base_mt_task.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/base_mt_task.c b/bin/base_mt_task.c index a1e3731..19afb28 100644 --- a/bin/base_mt_task.c +++ b/bin/base_mt_task.c | |||
@@ -37,7 +37,7 @@ struct thread_context { | |||
37 | /* The real-time thread program. Doesn't have to be the same for | 37 | /* The real-time thread program. Doesn't have to be the same for |
38 | * all threads. Here, we only have one that will invoke job(). | 38 | * all threads. Here, we only have one that will invoke job(). |
39 | */ | 39 | */ |
40 | void* rt_thread(struct thread_context* ctx); | 40 | void* rt_thread(void *tcontext); |
41 | 41 | ||
42 | /* Declare the periodically invoked job. | 42 | /* Declare the periodically invoked job. |
43 | * Returns 1 -> task should exit. | 43 | * Returns 1 -> task should exit. |
@@ -95,7 +95,7 @@ int main(int argc, char** argv) | |||
95 | */ | 95 | */ |
96 | for (i = 0; i < NUM_THREADS; i++) { | 96 | for (i = 0; i < NUM_THREADS; i++) { |
97 | ctx[i].id = i; | 97 | ctx[i].id = i; |
98 | pthread_create(task + i, NULL, rt_thread, ctx + i); | 98 | pthread_create(task + i, NULL, rt_thread, (void *) (ctx + i)); |
99 | } | 99 | } |
100 | 100 | ||
101 | 101 | ||
@@ -118,9 +118,10 @@ int main(int argc, char** argv) | |||
118 | * real-time app. Notice, that init_rt_thread() is called to initialized per-thread | 118 | * real-time app. Notice, that init_rt_thread() is called to initialized per-thread |
119 | * data structures of the LITMUS^RT user space libary. | 119 | * data structures of the LITMUS^RT user space libary. |
120 | */ | 120 | */ |
121 | void* rt_thread(struct thread_context* ctx) | 121 | void* rt_thread(void *tcontext) |
122 | { | 122 | { |
123 | int do_exit; | 123 | int do_exit; |
124 | struct thread_context *ctx = (struct thread_context *) tcontext; | ||
124 | 125 | ||
125 | /* Make presence visible. */ | 126 | /* Make presence visible. */ |
126 | printf("RT Thread %d active.\n", ctx->id); | 127 | printf("RT Thread %d active.\n", ctx->id); |