task2.c 465 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
#include "system.h"
#include <stdio.h>

rtems_task Task2_EntryPoint(rtems_task_argument argument)
{
    int task_no = (int) argument;
    printf("Inside task %d...\n", task_no);
    fflush(stdout);

    int j;
    long long int dummy = 0;
12
    for(j=0; j<500000; j++) {
13 14 15 16 17 18 19 20
        int k;
        for(k=0; k<100; k++)
            dummy ^= k;
        dummy++;
    }
    printf("Computed value by task %d was %lld\n", task_no, dummy);
    rtems_task_delete(RTEMS_SELF);
}