Diff for /libaitsched/example/test.c between versions 1.6.8.10 and 1.9

version 1.6.8.10, 2012/08/02 13:45:02 version 1.9, 2012/08/21 12:54:39
Line 22  void *event(sched_task_t *arg) Line 22  void *event(sched_task_t *arg)
         return NULL;          return NULL;
 }  }
   
void *eventlo(sched_task_t *arg)void *regular(sched_task_t *arg)
 {  {
        printf("EventLOW::\n");        printf("Task::\n");
         return NULL;          return NULL;
 }  }
   
Line 36  void *timer(sched_task_t *arg) Line 36  void *timer(sched_task_t *arg)
   
 void *r(sched_task_t *arg)  void *r(sched_task_t *arg)
 {  {
        printf("read:: bytes\n");        printf("read:: %d bytes wait\n", TASK_RET(arg));
         Kill++;          Kill++;
         return NULL;          return NULL;
 }  }
   
 void *w(sched_task_t *arg)  void *w(sched_task_t *arg)
 {  {
        printf("write::\n");        printf("write:: %d bytes wait\n", TASK_RET(arg));
         return NULL;          return NULL;
 }  }
   
Line 115  void *aiobulkwrite(sched_task_t *arg) Line 115  void *aiobulkwrite(sched_task_t *arg)
 }  }
 #endif  #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)  void sig(int s)
 {  {
         switch (s) {          switch (s) {
Line 179  main(int argc, char **argv) Line 185  main(int argc, char **argv)
                 return 2;                  return 2;
         }          }
   
        if (!schedEventLo(root, eventlo, "piuk", 1111, NULL, 0)) {        if (!schedTask(root, regular, "piuk", 1111, NULL, 0)) {
                 printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());                  printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());
                 return 3;                  return 3;
         }          }
Line 197  main(int argc, char **argv) Line 203  main(int argc, char **argv)
         if (!schedWrite(root, w, "www", f, NULL, 0)) {          if (!schedWrite(root, w, "www", f, NULL, 0)) {
                 printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());                  printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());
                 return 6;                  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  #ifdef AIO_SUPPORT

Removed from v.1.6.8.10  
changed lines
  Added in v.1.9


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>