|
|
| version 1.10.2.2, 2012/08/01 14:11:43 | version 1.10.2.3, 2012/08/01 14:27:52 |
|---|---|
| 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 }; |
| #ifdef EVFILT_AIO | |
| struct aiocb *acb; | |
| #endif | |
| if (!t || !TASK_ROOT(t)) | if (!t || !TASK_ROOT(t)) |
| return (void*) -1; | return (void*) -1; |
| Line 163 sched_hook_cancel(void *task, void *arg __unused) | Line 166 sched_hook_cancel(void *task, void *arg __unused) |
| #else | #else |
| EV_SET(&chg[0], TASK_VAL(t), EVFILT_AIO, EV_DELETE, 0, 0, (void*) TASK_VAL(t)); | EV_SET(&chg[0], TASK_VAL(t), EVFILT_AIO, EV_DELETE, 0, 0, (void*) TASK_VAL(t)); |
| #endif | #endif |
| if (TASK_VAL(t)) { | acb = (struct aiocb*) TASK_VAL(t); |
| free((void*) TASK_VAL(t)); | if (acb) { |
| aio_cancel(acb->aio_fildes, acb); | |
| free(acb); | |
| TASK_VAL(t) = 0; | TASK_VAL(t) = 0; |
| } | } |
| break; | break; |