--- libaitsched/example/test.c 2012/08/08 08:25:39 1.8 +++ libaitsched/example/test.c 2012/08/21 12:54:39 1.9 @@ -36,14 +36,14 @@ void *timer(sched_task_t *arg) void *r(sched_task_t *arg) { - printf("read:: bytes\n"); + printf("read:: %d bytes wait\n", TASK_RET(arg)); Kill++; return NULL; } void *w(sched_task_t *arg) { - printf("write::\n"); + printf("write:: %d bytes wait\n", TASK_RET(arg)); return NULL; } @@ -115,6 +115,12 @@ void *aiobulkwrite(sched_task_t *arg) } #endif +void *thr(sched_task_t *arg) +{ + printf("thread(%lu):: %s\n", TASK_VAL(arg), (char*) TASK_ARG(arg)); + taskExit(arg, 42); +} + void sig(int s) { switch (s) { @@ -197,6 +203,19 @@ main(int argc, char **argv) if (!schedWrite(root, w, "www", f, NULL, 0)) { printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError()); return 6; + } + + if (!schedThread(root, thr, "mdaaaa this is thread task", 0, NULL, 0)) { + printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError()); + return 7; + } + if (!schedThread(root, thr, "mdaaaa this is thread task -detached", 42, NULL, 0)) { + printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError()); + return 7; + } + if (!schedThread(root, thr, "mdaaaa this is thread task -j", 0, NULL, 0)) { + printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError()); + return 7; } #ifdef AIO_SUPPORT