version 1.1.2.1, 2012/05/10 14:30:31
|
version 1.2.4.1, 2012/05/30 08:34:43
|
Line 3
|
Line 3
|
#include <fcntl.h> |
#include <fcntl.h> |
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/stat.h> |
#include <sys/stat.h> |
#include <sys/socket.h> | #include <sys/signal.h> |
#include <netinet/in.h> |
#include <netinet/in.h> |
#include <aitsched.h> |
#include <aitsched.h> |
|
|
Line 27 void *timer(sched_task_t *arg)
|
Line 27 void *timer(sched_task_t *arg)
|
return NULL; |
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) |
void *once(sched_task_t *arg) |
{ |
{ |
printf("once::\n"); |
printf("once::\n"); |
Line 47 main(int argc, char **argv)
|
Line 53 main(int argc, char **argv)
|
{ |
{ |
sched_root_task_t *root; |
sched_root_task_t *root; |
struct timespec ts = { 20, 0 }; |
struct timespec ts = { 20, 0 }; |
struct timespec p = { 0, 10000000 }; | // struct timespec p = { 0, 10000000 }; |
|
|
signal(SIGTERM, sig); |
signal(SIGTERM, sig); |
|
|
Line 83 main(int argc, char **argv)
|
Line 89 main(int argc, char **argv)
|
return 4; |
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); |
schedCallOnce(root, once, "000000", 42, NULL, 0); |
|
|
schedPolling(root, &p, NULL); | 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); |
schedRun(root, &Kill); |
schedEnd(&root); |
schedEnd(&root); |
return 0; |
return 0; |