Diff for /libaitsched/example/test_brut.c between versions 1.1.2.2 and 1.2

version 1.1.2.2, 2013/08/26 15:02:59 version 1.2, 2013/08/26 18:48:23
Line 103  void *thr(sched_task_t *arg) Line 103  void *thr(sched_task_t *arg)
 {  {
         printf("tid (%lx):: %s\n", TASK_VAL(arg), __func__);          printf("tid (%lx):: %s\n", TASK_VAL(arg), __func__);
         printf("tid (%lu):: %s\n", TASK_VAL(arg), (char*) TASK_ARG(arg));          printf("tid (%lu):: %s\n", TASK_VAL(arg), (char*) TASK_ARG(arg));
           fflush(stdout);
         taskExit(arg, 42);          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)  void *thr4kill(sched_task_t *arg)
 {  {
         char blah[BUFSIZ];          char blah[BUFSIZ];
Line 113  void *thr4kill(sched_task_t *arg) Line 122  void *thr4kill(sched_task_t *arg)
         printf("tid (%lx):: %s\n", TASK_VAL(arg), __func__);          printf("tid (%lx):: %s\n", TASK_VAL(arg), __func__);
   
         read(0, blah, sizeof blah);          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);          taskExit(arg, 0);
 }  }
   
Line 227  main(int argc, char **argv) Line 238  main(int argc, char **argv)
                 printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());                  printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());
                 return 5;                  return 5;
         } else {          } else {
                ts.tv_sec = 0;                ts.tv_sec = 1;
                ts.tv_nsec = 1000000;                ts.tv_nsec = 0;
         }          }
   
         if (!schedRTC(root, rtcinf, (void*) (intptr_t) ts.tv_sec, ts, (void*) 12, 0)) {          if (!schedRTC(root, rtcinf, (void*) (intptr_t) ts.tv_sec, ts, (void*) 12, 0)) {
Line 283  main(int argc, char **argv) Line 294  main(int argc, char **argv)
                 return 6;                  return 6;
         }          }
   
        if (!(t = schedThread(root, thr4kill, "0aaaa", 0, 0, NULL, 0))) {        if (!schedThread(root, thrinf, "OHOBOHO_i_BOZA", 0, NULL, 0)) {
                 printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());                  printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());
                 return 7;                  return 7;
         }          }
        if (!schedThread(root, thr, "mdaaaa this is thread task", 0, 131072, NULL, 0)) {        if (!schedThread(root, thrinf, "OHOBOHO_i_BOZA+1",  0, NULL, 0)) {
                 printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());                  printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());
                 return 7;                  return 7;
         }          }
        if (!schedThread(root, thr, "mdaaaa this is thread task -detached", 42, 0, NULL, 0)) {        if (!(t = schedThread(root, thr4kill, "0aaaa", 0, NULL, 0))) {
                 printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());                  printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());
                 return 7;                  return 7;
         }          }
        if (!schedThread(root, thr, "mdaaaa this is thread task -j", 0, 131072, NULL, 0)) {        if (!schedThread(root, thr, "mdaaaa this is thread task", 131072, NULL, 0)) {
                 printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());                  printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());
                 return 7;                  return 7;
         }          }
           if (!schedThread(root, thr, "mdaaaa this is thread task -detached", 0, NULL, 0)) {
                   printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());
                   return 7;
           }
           if (!schedThread(root, thr, "mdaaaa this is thread task -j", 131072, NULL, 0)) {
                   printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());
                   return 7;
           }
         printf("try to cancel tid = %lx\n", TASK_VAL(t));          printf("try to cancel tid = %lx\n", TASK_VAL(t));
         schedCancel(t);          schedCancel(t);
        if (!schedThread(root, thr, "mdaaaa this is thread task -j2", 0, 131072 * 2, NULL, 0)) {        if (!schedThread(root, thr, "mdaaaa this is thread task -j2", 131072 * 2, NULL, 0)) {
                 printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());                  printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());
                 return 7;                  return 7;
         }          }
        if (!(t = schedThread(root, thr4kill, "0aaaa", 42, /*4096*/0, NULL, 0))) {        if (!(t = schedThread(root, thr4kill, "0aaaa", /*4096*/0, NULL, 0))) {
                 printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());                  printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());
                 return 7;                  return 7;
         }          }
        if (!schedThread(root, thr, "mdaaaa this is thread task -j3", 0, 0, NULL, 0)) {        if (!schedThread(root, thr, "mdaaaa this is thread task -j3", 0, NULL, 0)) {
                 printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());                  printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());
                 return 7;                  return 7;
         }          }

Removed from v.1.1.2.2  
changed lines
  Added in v.1.2


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