Diff for /libaitsched/src/hooks.c between versions 1.14.2.2 and 1.14.2.4

version 1.14.2.2, 2012/08/22 13:37:23 version 1.14.2.4, 2012/08/22 23:47:22
Line 107  sched_hook_cancel(void *task, void *arg __unused) Line 107  sched_hook_cancel(void *task, void *arg __unused)
         sched_task_t *t = task;          sched_task_t *t = task;
         struct kevent chg[1];          struct kevent chg[1];
         struct timespec timeout = { 0, 0 };          struct timespec timeout = { 0, 0 };
           register int i = 0;
 #ifdef AIO_SUPPORT  #ifdef AIO_SUPPORT
         struct aiocb *acb;          struct aiocb *acb;
 #ifdef EVFILT_LIO  #ifdef EVFILT_LIO
         struct aiocb **acbs;          struct aiocb **acbs;
         register int i;  
 #endif  /* EVFILT_LIO */  #endif  /* EVFILT_LIO */
 #endif  /* AIO_SUPPORT */  #endif  /* AIO_SUPPORT */
   
Line 209  sched_hook_cancel(void *task, void *arg __unused) Line 209  sched_hook_cancel(void *task, void *arg __unused)
 #endif  #endif
                 case taskTHREAD:                  case taskTHREAD:
 #ifdef HAVE_LIBPTHREAD  #ifdef HAVE_LIBPTHREAD
                        pthread_cancel((pthread_t) TASK_VAL(t));                        /* try to wait for valid thread id */
                         for (i = 0; i < MAX_TASK_MISS && 
                                         pthread_kill((pthread_t) TASK_VAL(t), 0); i++)
                                 usleep(10);
                         /* try to sure thread is cancelled */
                         for (i = 0; i < MAX_TASK_MISS && 
                                         !pthread_kill((pthread_t) TASK_VAL(t), 0); i++)
                                 pthread_cancel((pthread_t) TASK_VAL(t));
                         if (TASK_FLAG(t) == PTHREAD_CREATE_JOINABLE)    /* joinable thread */                          if (TASK_FLAG(t) == PTHREAD_CREATE_JOINABLE)    /* joinable thread */
                                 schedTask(TASK_ROOT(t), _sched_threadJoin, TASK_ARG(t),                                  schedTask(TASK_ROOT(t), _sched_threadJoin, TASK_ARG(t),
                                                 TASK_VAL(t), TASK_DATA(t), TASK_DATLEN(t));                                                  TASK_VAL(t), TASK_DATA(t), TASK_DATLEN(t));
Line 249  sched_hook_thread(void *task, void *arg) Line 256  sched_hook_thread(void *task, void *arg)
                 pthread_sigmask(SIG_SETMASK, &os, NULL);                  pthread_sigmask(SIG_SETMASK, &os, NULL);
                 return (void*) -1;                  return (void*) -1;
         }          }
         pthread_sigmask(SIG_SETMASK, &os, NULL);  
   
         if (!TASK_ISLOCKED(t))          if (!TASK_ISLOCKED(t))
                 TASK_LOCK(t);                  TASK_LOCK(t);
   
         TASK_VAL(t) = (u_long) tid;          TASK_VAL(t) = (u_long) tid;
           pthread_sigmask(SIG_SETMASK, &os, NULL);
         return NULL;          return NULL;
 }  }
 #endif  #endif

Removed from v.1.14.2.2  
changed lines
  Added in v.1.14.2.4


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