--- libaitsched/example/test_time.c 2012/05/10 14:44:22 1.1.2.2 +++ libaitsched/example/test_time.c 2012/05/30 08:34:43 1.2.4.1 @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include @@ -27,6 +27,12 @@ void *timer(sched_task_t *arg) return NULL; } +void *alarmz(sched_task_t *arg) +{ + printf("Alarm %ld sec::\n", (intptr_t) TASK_ARG(arg)); + return NULL; +} + void *once(sched_task_t *arg) { printf("once::\n"); @@ -83,7 +89,16 @@ main(int argc, char **argv) return 4; } + ts.tv_sec = 11; + if (!schedAlarm(root, alarmz, (void*) ts.tv_sec, ts, NULL, 0)) { + printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError()); + return 5; + } + schedCallOnce(root, once, "000000", 42, NULL, 0); + + printf("read_queue=%d timer_queue=%d\n", + ROOT_QUEUE_EMPTY(root, read), ROOT_QUEUE_EMPTY(root, timer)); // schedPolling(root, &p, NULL); schedRun(root, &Kill);