--- libaitsched/example/test_brut.c 2013/08/26 15:02:59 1.1.2.2 +++ libaitsched/example/test_brut.c 2013/08/26 18:42:32 1.1.2.3 @@ -103,9 +103,18 @@ void *thr(sched_task_t *arg) { printf("tid (%lx):: %s\n", TASK_VAL(arg), __func__); printf("tid (%lu):: %s\n", TASK_VAL(arg), (char*) TASK_ARG(arg)); + fflush(stdout); taskExit(arg, 42); } +void *thrinf(sched_task_t *arg) +{ + printf("tid INF (%lu):: %s %s\n", TASK_VAL(arg), __func__, (char*) TASK_ARG(arg)); + fflush(stdout); + schedThreadSelf(arg); + taskExit(arg, 42); +} + void *thr4kill(sched_task_t *arg) { char blah[BUFSIZ]; @@ -113,7 +122,9 @@ void *thr4kill(sched_task_t *arg) printf("tid (%lx):: %s\n", TASK_VAL(arg), __func__); read(0, blah, sizeof blah); - printf("never see!!! (%lx):: %s (%d == %d)\n", TASK_VAL(arg), (char*) TASK_ARG(arg), TASK_TYPE(arg), taskTHREAD); + if (arg) + printf("never see!!! (%lx):: %s (%d == %d)\n", arg ? TASK_VAL(arg) : 0, + (char*) arg ? TASK_ARG(arg) : NULL, arg ? TASK_TYPE(arg) : -1, taskTHREAD); taskExit(arg, 0); } @@ -227,8 +238,8 @@ main(int argc, char **argv) printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError()); return 5; } else { - ts.tv_sec = 0; - ts.tv_nsec = 1000000; + ts.tv_sec = 1; + ts.tv_nsec = 0; } if (!schedRTC(root, rtcinf, (void*) (intptr_t) ts.tv_sec, ts, (void*) 12, 0)) { @@ -283,6 +294,16 @@ main(int argc, char **argv) return 6; } + if (!schedThread(root, thrinf, "OHOBOHO_i_BOZA", 0, 0, NULL, 0)) { + printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError()); + return 7; + } + /* + if (!schedThread(root, thrinf, "OHOBOHO_i_BOZA+detach", 42, 0, NULL, 0)) { + printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError()); + return 7; + } + */ if (!(t = schedThread(root, thr4kill, "0aaaa", 0, 0, NULL, 0))) { printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError()); return 7;