repositories
/
des2015.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
skeleton ex10
[des2015.git]
/
mart
/
ex03
/
ex03a.c
diff --git
a/mart/ex03/ex03a.c
b/mart/ex03/ex03a.c
index
195a64f
..
7d6b061
100644
(file)
--- a/
mart/ex03/ex03a.c
+++ b/
mart/ex03/ex03a.c
@@
-18,39
+18,37
@@
int global = 0;
void taskOne(void *arg)
{
void taskOne(void *arg)
{
- int i;
- for (i=0; i < ITER; i++)
- {
- rt_printf("I am taskOne and global = %d................\n", ++global);
- }
+
int i;
+
for (i=0; i < ITER; i++)
+
{
+
rt_printf("I am taskOne and global = %d................\n", ++global);
+
}
}
void taskTwo(void *arg)
{
}
void taskTwo(void *arg)
{
- int i;
- for (i=0; i < ITER; i++)
- {
- rt_printf("I am taskTwo and global = %d----------------\n", --global);
- }
+
int i;
+
for (i=0; i < ITER; i++)
+
{
+
rt_printf("I am taskTwo and global = %d----------------\n", --global);
+
}
}
int main(int argc, char* argv[])
{
}
int main(int argc, char* argv[])
{
- /* Perform auto-init of rt_print buffers if the task doesn't do so */
- rt_print_auto_init(1);
+
/* Perform auto-init of rt_print buffers if the task doesn't do so */
+
rt_print_auto_init(1);
- /* Avoids memory swapping for this program */
- mlockall(MCL_CURRENT|MCL_FUTURE);
+
/* Avoids memory swapping for this program */
+
mlockall(MCL_CURRENT|MCL_FUTURE);
- /* create the two tasks */
- rt_task_create(&t1, "task1", 0, 1, 0);
- rt_task_create(&t2, "task2", 0, 1, 0);
+
/* create the two tasks */
+
rt_task_create(&t1, "task1", 0, 1, 0);
+
rt_task_create(&t2, "task2", 0, 1, 0);
- /* start the two tasks */
- rt_task_start(&t1, &taskOne, 0);
- rt_task_start(&t2, &taskTwo, 0);
+
/* start the two tasks */
+
rt_task_start(&t1, &taskOne, 0);
+
rt_task_start(&t2, &taskTwo, 0);
- return 0;
+
return 0;
}
}
-
-