|
|
| version 1.31.2.2, 2017/08/31 12:19:07 | version 1.32, 2017/09/04 08:47:43 |
|---|---|
| Line 555 sched_hook_read(void *task, void *arg __unused) | Line 555 sched_hook_read(void *task, void *arg __unused) |
| struct kevent chg[1]; | struct kevent chg[1]; |
| struct timespec timeout = { 0, 0 }; | struct timespec timeout = { 0, 0 }; |
| #elif SUP_ENABLE == EP_SUPPORT | #elif SUP_ENABLE == EP_SUPPORT |
| struct epoll_event ee = { .events = EPOLLIN | EPOLLPRI, .data.fd = 0 }; | struct epoll_event ee; |
| int flg = 0; | int flg = 0; |
| #endif | #endif |
| Line 578 sched_hook_read(void *task, void *arg __unused) | Line 578 sched_hook_read(void *task, void *arg __unused) |
| return (void*) -1; | return (void*) -1; |
| } | } |
| #elif SUP_ENABLE == EP_SUPPORT | #elif SUP_ENABLE == EP_SUPPORT |
| ee.data.fd = TASK_FD(t); | |
| ee.events = EPOLLIN | EPOLLPRI; | |
| if (FD_ISSET(TASK_FD(t), &r->root_fds[0])) | if (FD_ISSET(TASK_FD(t), &r->root_fds[0])) |
| flg |= 1; | flg |= 1; |
| if (FD_ISSET(TASK_FD(t), &r->root_fds[1])) { | if (FD_ISSET(TASK_FD(t), &r->root_fds[1])) { |
| Line 585 sched_hook_read(void *task, void *arg __unused) | Line 587 sched_hook_read(void *task, void *arg __unused) |
| ee.events |= EPOLLOUT; | ee.events |= EPOLLOUT; |
| } | } |
| ee.data.fd = TASK_FD(t); | |
| if (epoll_ctl(r->root_kq, flg ? EPOLL_CTL_MOD : EPOLL_CTL_ADD, TASK_FD(t), &ee) == -1) { | if (epoll_ctl(r->root_kq, flg ? EPOLL_CTL_MOD : EPOLL_CTL_ADD, TASK_FD(t), &ee) == -1) { |
| if (r->root_hooks.hook_exec.exception) | if (r->root_hooks.hook_exec.exception) |
| r->root_hooks.hook_exec.exception(r, NULL); | r->root_hooks.hook_exec.exception(r, NULL); |
| Line 619 sched_hook_write(void *task, void *arg __unused) | Line 620 sched_hook_write(void *task, void *arg __unused) |
| struct kevent chg[1]; | struct kevent chg[1]; |
| struct timespec timeout = { 0, 0 }; | struct timespec timeout = { 0, 0 }; |
| #elif SUP_ENABLE == EP_SUPPORT | #elif SUP_ENABLE == EP_SUPPORT |
| struct epoll_event ee = { .events = EPOLLOUT, .data.fd = 0 }; | struct epoll_event ee; |
| int flg = 0; | int flg = 0; |
| #endif | #endif |
| Line 642 sched_hook_write(void *task, void *arg __unused) | Line 643 sched_hook_write(void *task, void *arg __unused) |
| return (void*) -1; | return (void*) -1; |
| } | } |
| #elif SUP_ENABLE == EP_SUPPORT | #elif SUP_ENABLE == EP_SUPPORT |
| ee.data.fd = TASK_FD(t); | |
| ee.events = EPOLLOUT; | |
| if (FD_ISSET(TASK_FD(t), &r->root_fds[0])) { | if (FD_ISSET(TASK_FD(t), &r->root_fds[0])) { |
| flg |= 1; | flg |= 1; |
| ee.events |= EPOLLIN | EPOLLPRI; | ee.events |= EPOLLIN | EPOLLPRI; |
| Line 649 sched_hook_write(void *task, void *arg __unused) | Line 653 sched_hook_write(void *task, void *arg __unused) |
| if (FD_ISSET(TASK_FD(t), &r->root_fds[1])) | if (FD_ISSET(TASK_FD(t), &r->root_fds[1])) |
| flg |= 2; | flg |= 2; |
| ee.data.fd = TASK_FD(t); | |
| if (epoll_ctl(r->root_kq, flg ? EPOLL_CTL_MOD : EPOLL_CTL_ADD, TASK_FD(t), &ee) == -1) { | if (epoll_ctl(r->root_kq, flg ? EPOLL_CTL_MOD : EPOLL_CTL_ADD, TASK_FD(t), &ee) == -1) { |
| if (r->root_hooks.hook_exec.exception) | if (r->root_hooks.hook_exec.exception) |
| r->root_hooks.hook_exec.exception(r, NULL); | r->root_hooks.hook_exec.exception(r, NULL); |
| Line 884 fetch_hook_kevent_proceed(int en, struct kevent *res, | Line 887 fetch_hook_kevent_proceed(int en, struct kevent *res, |
| switch (res[i].filter) { | switch (res[i].filter) { |
| case EVFILT_READ: | case EVFILT_READ: |
| TAILQ_FOREACH_SAFE(task, &r->root_read, task_node, tmp) { | TAILQ_FOREACH_SAFE(task, &r->root_read, task_node, tmp) { |
| if (TASK_FD(task) != ((intptr_t) res[i].udata)) | if (TASK_FD(task) == ((intptr_t) res[i].udata)) { |
| continue; | |
| else { | |
| TASK_RET(task) = res[i].data; | TASK_RET(task) = res[i].data; |
| TASK_FLAG(task) = (u_long) res[i].fflags; | TASK_FLAG(task) = (u_long) res[i].fflags; |
| } | |
| /* remove read handle */ | |
| remove_task_from(task, &r->root_read); | |
| if (r->root_hooks.hook_exec.exception && res[i].flags & EV_EOF) { | /* remove read handle */ |
| if (r->root_hooks.hook_exec.exception(r, (void*) EV_EOF)) { | remove_task_from(task, &r->root_read); |
| task->task_type = taskUNUSE; | |
| insert_task_to(task, &r->root_unuse); | if (r->root_hooks.hook_exec.exception && res[i].flags & EV_EOF) { |
| if (r->root_hooks.hook_exec.exception(r, (void*) EV_EOF)) { | |
| task->task_type = taskUNUSE; | |
| insert_task_to(task, &r->root_unuse); | |
| } else { | |
| task->task_type = taskREADY; | |
| insert_task_to(task, &r->root_ready); | |
| } | |
| } else { | } else { |
| task->task_type = taskREADY; | task->task_type = taskREADY; |
| insert_task_to(task, &r->root_ready); | insert_task_to(task, &r->root_ready); |
| } | } |
| } else { | break; |
| task->task_type = taskREADY; | |
| insert_task_to(task, &r->root_ready); | |
| } | } |
| } | } |
| break; | break; |
| case EVFILT_WRITE: | case EVFILT_WRITE: |
| TAILQ_FOREACH_SAFE(task, &r->root_write, task_node, tmp) { | TAILQ_FOREACH_SAFE(task, &r->root_write, task_node, tmp) { |
| if (TASK_FD(task) != ((intptr_t) res[i].udata)) | if (TASK_FD(task) == ((intptr_t) res[i].udata)) { |
| continue; | |
| else { | |
| TASK_RET(task) = res[i].data; | TASK_RET(task) = res[i].data; |
| TASK_FLAG(task) = (u_long) res[i].fflags; | TASK_FLAG(task) = (u_long) res[i].fflags; |
| } | |
| /* remove write handle */ | |
| remove_task_from(task, &r->root_write); | |
| if (r->root_hooks.hook_exec.exception && res[i].flags & EV_EOF) { | /* remove write handle */ |
| if (r->root_hooks.hook_exec.exception(r, (void*) EV_EOF)) { | remove_task_from(task, &r->root_write); |
| task->task_type = taskUNUSE; | |
| insert_task_to(task, &r->root_unuse); | if (r->root_hooks.hook_exec.exception && res[i].flags & EV_EOF) { |
| if (r->root_hooks.hook_exec.exception(r, (void*) EV_EOF)) { | |
| task->task_type = taskUNUSE; | |
| insert_task_to(task, &r->root_unuse); | |
| } else { | |
| task->task_type = taskREADY; | |
| insert_task_to(task, &r->root_ready); | |
| } | |
| } else { | } else { |
| task->task_type = taskREADY; | task->task_type = taskREADY; |
| insert_task_to(task, &r->root_ready); | insert_task_to(task, &r->root_ready); |
| } | } |
| } else { | break; |
| task->task_type = taskREADY; | |
| insert_task_to(task, &r->root_ready); | |
| } | } |
| } | } |
| break; | break; |
| case EVFILT_TIMER: | case EVFILT_TIMER: |
| TAILQ_FOREACH_SAFE(task, &r->root_alarm, task_node, tmp) { | TAILQ_FOREACH_SAFE(task, &r->root_alarm, task_node, tmp) { |
| if ((uintptr_t) TASK_DATA(task) != ((uintptr_t) res[i].udata)) | if ((uintptr_t) TASK_DATA(task) == ((uintptr_t) res[i].udata)) { |
| continue; | |
| else { | |
| TASK_RET(task) = res[i].data; | TASK_RET(task) = res[i].data; |
| TASK_FLAG(task) = (u_long) res[i].fflags; | TASK_FLAG(task) = (u_long) res[i].fflags; |
| /* remove alarm handle */ | |
| transit_task2ready(task, &r->root_alarm); | |
| break; | |
| } | } |
| /* remove alarm handle */ | |
| transit_task2ready(task, &r->root_alarm); | |
| } | } |
| break; | break; |
| case EVFILT_VNODE: | case EVFILT_VNODE: |
| TAILQ_FOREACH_SAFE(task, &r->root_node, task_node, tmp) { | TAILQ_FOREACH_SAFE(task, &r->root_node, task_node, tmp) { |
| if (TASK_FD(task) != ((intptr_t) res[i].udata)) | if (TASK_FD(task) == ((intptr_t) res[i].udata)) { |
| continue; | |
| else { | |
| TASK_RET(task) = res[i].data; | TASK_RET(task) = res[i].data; |
| TASK_FLAG(task) = (u_long) res[i].fflags; | TASK_FLAG(task) = (u_long) res[i].fflags; |
| /* remove node handle */ | |
| transit_task2ready(task, &r->root_node); | |
| break; | |
| } | } |
| /* remove node handle */ | |
| transit_task2ready(task, &r->root_node); | |
| } | } |
| break; | break; |
| case EVFILT_PROC: | case EVFILT_PROC: |
| TAILQ_FOREACH_SAFE(task, &r->root_proc, task_node, tmp) { | TAILQ_FOREACH_SAFE(task, &r->root_proc, task_node, tmp) { |
| if (TASK_VAL(task) != ((uintptr_t) res[i].udata)) | if (TASK_VAL(task) == ((uintptr_t) res[i].udata)) { |
| continue; | |
| else { | |
| TASK_RET(task) = res[i].data; | TASK_RET(task) = res[i].data; |
| TASK_FLAG(task) = (u_long) res[i].fflags; | TASK_FLAG(task) = (u_long) res[i].fflags; |
| /* remove proc handle */ | |
| transit_task2ready(task, &r->root_proc); | |
| break; | |
| } | } |
| /* remove proc handle */ | |
| transit_task2ready(task, &r->root_proc); | |
| } | } |
| break; | break; |
| case EVFILT_SIGNAL: | case EVFILT_SIGNAL: |
| TAILQ_FOREACH_SAFE(task, &r->root_signal, task_node, tmp) { | TAILQ_FOREACH_SAFE(task, &r->root_signal, task_node, tmp) { |
| if (TASK_VAL(task) != ((uintptr_t) res[i].udata)) | if (TASK_VAL(task) == ((uintptr_t) res[i].udata)) { |
| continue; | |
| else { | |
| TASK_RET(task) = res[i].data; | TASK_RET(task) = res[i].data; |
| TASK_FLAG(task) = (u_long) res[i].fflags; | TASK_FLAG(task) = (u_long) res[i].fflags; |
| /* remove signal handle */ | |
| transit_task2ready(task, &r->root_signal); | |
| break; | |
| } | } |
| /* remove signal handle */ | |
| transit_task2ready(task, &r->root_signal); | |
| } | } |
| break; | break; |
| #ifdef AIO_SUPPORT | #ifdef AIO_SUPPORT |
| case EVFILT_AIO: | case EVFILT_AIO: |
| TAILQ_FOREACH_SAFE(task, &r->root_aio, task_node, tmp) { | TAILQ_FOREACH_SAFE(task, &r->root_aio, task_node, tmp) { |
| acb = (struct aiocb*) TASK_VAL(task); | acb = (struct aiocb*) TASK_VAL(task); |
| if (acb != ((struct aiocb*) res[i].udata)) | if (acb == ((struct aiocb*) res[i].udata)) { |
| continue; | |
| else { | |
| TASK_RET(task) = res[i].data; | TASK_RET(task) = res[i].data; |
| TASK_FLAG(task) = (u_long) res[i].fflags; | TASK_FLAG(task) = (u_long) res[i].fflags; |
| } | |
| /* remove user handle */ | /* remove user handle */ |
| transit_task2ready(task, &r->root_aio); | transit_task2ready(task, &r->root_aio); |
| fd = acb->aio_fildes; | fd = acb->aio_fildes; |
| if ((len = aio_return(acb)) != -1) { | if ((len = aio_return(acb)) != -1) { |
| if (lseek(fd, acb->aio_offset + len, SEEK_CUR) == -1) | if (lseek(fd, acb->aio_offset + len, SEEK_CUR) == -1) |
| LOGERR; | |
| } else | |
| LOGERR; | LOGERR; |
| } else | free(acb); |
| LOGERR; | TASK_DATLEN(task) = (u_long) len; |
| free(acb); | TASK_FD(task) = fd; |
| TASK_DATLEN(task) = (u_long) len; | break; |
| TASK_FD(task) = fd; | } |
| } | } |
| break; | break; |
| #ifdef EVFILT_LIO | #ifdef EVFILT_LIO |
| case EVFILT_LIO: | case EVFILT_LIO: |
| TAILQ_FOREACH_SAFE(task, &r->root_lio, task_node, tmp) { | TAILQ_FOREACH_SAFE(task, &r->root_lio, task_node, tmp) { |
| acbs = (struct aiocb**) TASK_VAL(task); | acbs = (struct aiocb**) TASK_VAL(task); |
| if (acbs != ((struct aiocb**) res[i].udata)) | if (acbs == ((struct aiocb**) res[i].udata)) { |
| continue; | |
| else { | |
| TASK_RET(task) = res[i].data; | TASK_RET(task) = res[i].data; |
| TASK_FLAG(task) = (u_long) res[i].fflags; | TASK_FLAG(task) = (u_long) res[i].fflags; |
| } | |
| /* remove user handle */ | |
| transit_task2ready(task, &r->root_lio); | |
| iv = (struct iovec*) TASK_DATA(task); | /* remove user handle */ |
| fd = acbs[0]->aio_fildes; | transit_task2ready(task, &r->root_lio); |
| off = acbs[0]->aio_offset; | |
| for (len = 0; i < TASK_DATLEN(task); len += l, i++) { | |
| if ((iv[i].iov_len = aio_return(acbs[i])) == -1) | |
| l = 0; | |
| else | |
| l = iv[i].iov_len; | |
| free(acbs[i]); | |
| } | |
| free(acbs); | |
| TASK_DATLEN(task) = (u_long) len; | |
| TASK_FD(task) = fd; | |
| if (lseek(fd, off + len, SEEK_CUR) == -1) | iv = (struct iovec*) TASK_DATA(task); |
| LOGERR; | fd = acbs[0]->aio_fildes; |
| off = acbs[0]->aio_offset; | |
| for (len = 0; i < TASK_DATLEN(task); len += l, i++) { | |
| if ((iv[i].iov_len = aio_return(acbs[i])) == -1) | |
| l = 0; | |
| else | |
| l = iv[i].iov_len; | |
| free(acbs[i]); | |
| } | |
| free(acbs); | |
| TASK_DATLEN(task) = (u_long) len; | |
| TASK_FD(task) = fd; | |
| if (lseek(fd, off + len, SEEK_CUR) == -1) | |
| LOGERR; | |
| break; | |
| } | |
| } | } |
| break; | break; |
| #endif /* EVFILT_LIO */ | #endif /* EVFILT_LIO */ |
| Line 1040 fetch_hook_kevent_proceed(int en, struct kevent *res, | Line 1043 fetch_hook_kevent_proceed(int en, struct kevent *res, |
| #ifdef EVFILT_USER | #ifdef EVFILT_USER |
| case EVFILT_USER: | case EVFILT_USER: |
| TAILQ_FOREACH_SAFE(task, &r->root_user, task_node, tmp) { | TAILQ_FOREACH_SAFE(task, &r->root_user, task_node, tmp) { |
| if (TASK_VAL(task) != ((uintptr_t) res[i].udata)) | if (TASK_VAL(task) == ((uintptr_t) res[i].udata)) { |
| continue; | |
| else { | |
| TASK_RET(task) = res[i].data; | TASK_RET(task) = res[i].data; |
| TASK_FLAG(task) = (u_long) res[i].fflags; | TASK_FLAG(task) = (u_long) res[i].fflags; |
| /* remove user handle */ | |
| transit_task2ready(task, &r->root_user); | |
| break; | |
| } | } |
| /* remove user handle */ | |
| transit_task2ready(task, &r->root_user); | |
| } | } |
| break; | break; |
| #endif /* EVFILT_USER */ | #endif /* EVFILT_USER */ |
| Line 1067 fetch_hook_kevent_proceed(int en, struct kevent *res, | Line 1070 fetch_hook_kevent_proceed(int en, struct kevent *res, |
| static inline void | static inline void |
| fetch_hook_epoll_proceed(int en, struct epoll_event *res, sched_root_task_t *r) | fetch_hook_epoll_proceed(int en, struct epoll_event *res, sched_root_task_t *r) |
| { | { |
| register int i, flg, oevt; | register int i, flg; |
| int ops = EPOLL_CTL_DEL; | int ops = EPOLL_CTL_DEL; |
| sched_task_t *task, *tmp; | sched_task_t *t, *tmp, *task; |
| struct epoll_event evt[1]; | struct epoll_event evt[1]; |
| for (i = 0; i < en; i++) { | for (i = 0; i < en; i++) { |
| memcpy(evt, &res[i], sizeof evt); | memcpy(evt, &res[i], sizeof evt); |
| oevt = evt->events & EPOLLOUT; | |
| if (evt->events & (EPOLLIN | EPOLLPRI)) { | if (evt->events & (EPOLLIN | EPOLLPRI)) { |
| flg = 0; | flg = 0; |
| TAILQ_FOREACH_SAFE(task, &r->root_read, task_node, tmp) { | task = NULL; |
| if (TASK_FD(task) != evt->data.fd) | TAILQ_FOREACH_SAFE(t, &r->root_read, task_node, tmp) { |
| continue; | if (TASK_FD(t) == evt->data.fd) { |
| else { | if (!flg) |
| task = t; | |
| flg++; | flg++; |
| TASK_FLAG(task) = ioctl(TASK_FD(task), FIONREAD, &TASK_RET(task)); | |
| } | } |
| } | |
| if (flg && task) { | |
| TASK_FLAG(task) = ioctl(TASK_FD(task), FIONREAD, &TASK_RET(task)); | |
| /* remove read handle */ | /* remove read handle */ |
| remove_task_from(task, &r->root_read); | remove_task_from(task, &r->root_read); |
| Line 1101 fetch_hook_epoll_proceed(int en, struct epoll_event *r | Line 1107 fetch_hook_epoll_proceed(int en, struct epoll_event *r |
| task->task_type = taskREADY; | task->task_type = taskREADY; |
| insert_task_to(task, &r->root_ready); | insert_task_to(task, &r->root_ready); |
| } | } |
| } | |
| if (flg) { | |
| evt->events ^= evt->events; | evt->events ^= evt->events; |
| if (FD_ISSET(evt->data.fd, &r->root_fds[1])) { | if (FD_ISSET(evt->data.fd, &r->root_fds[1])) { |
| ops = EPOLL_CTL_MOD; | ops = EPOLL_CTL_MOD; |
| Line 1115 fetch_hook_epoll_proceed(int en, struct epoll_event *r | Line 1119 fetch_hook_epoll_proceed(int en, struct epoll_event *r |
| } else | } else |
| FD_CLR(evt->data.fd, &r->root_fds[0]); | FD_CLR(evt->data.fd, &r->root_fds[0]); |
| } | } |
| } | } else if (evt->events & EPOLLOUT) { |
| if (oevt) { | |
| flg = 0; | flg = 0; |
| TAILQ_FOREACH_SAFE(task, &r->root_write, task_node, tmp) { | task = NULL; |
| if (TASK_FD(task) != evt->data.fd) | TAILQ_FOREACH_SAFE(t, &r->root_write, task_node, tmp) { |
| continue; | if (TASK_FD(t) == evt->data.fd) { |
| else { | if (!flg) |
| task = t; | |
| flg++; | flg++; |
| TASK_FLAG(task) = ioctl(TASK_FD(task), | |
| FIONWRITE, &TASK_RET(task)); | |
| } | } |
| } | |
| if (flg && task) { | |
| TASK_FLAG(task) = ioctl(TASK_FD(task), FIONWRITE, &TASK_RET(task)); | |
| /* remove write handle */ | /* remove write handle */ |
| remove_task_from(task, &r->root_write); | remove_task_from(task, &r->root_write); |
| Line 1143 fetch_hook_epoll_proceed(int en, struct epoll_event *r | Line 1148 fetch_hook_epoll_proceed(int en, struct epoll_event *r |
| task->task_type = taskREADY; | task->task_type = taskREADY; |
| insert_task_to(task, &r->root_ready); | insert_task_to(task, &r->root_ready); |
| } | } |
| } | |
| if (flg) { | |
| evt->events ^= evt->events; | evt->events ^= evt->events; |
| if (FD_ISSET(evt->data.fd, &r->root_fds[0])) { | if (FD_ISSET(evt->data.fd, &r->root_fds[0])) { |
| ops = EPOLL_CTL_MOD; | ops = EPOLL_CTL_MOD; |
| Line 1174 static inline void | Line 1177 static inline void |
| fetch_hook_select_proceed(int en, fd_set rfd, fd_set wfd, fd_set xfd, sched_root_task_t *r) | fetch_hook_select_proceed(int en, fd_set rfd, fd_set wfd, fd_set xfd, sched_root_task_t *r) |
| { | { |
| register int i, flg; | register int i, flg; |
| sched_task_t *task, *tmp; | sched_task_t *t, *tmp, *task = NULL; |
| /* skip select check if return value from select is zero */ | /* skip select check if return value from select is zero */ |
| if (!en) | if (!en) |
| Line 1183 fetch_hook_select_proceed(int en, fd_set rfd, fd_set w | Line 1186 fetch_hook_select_proceed(int en, fd_set rfd, fd_set w |
| for (i = 0; i < r->root_kq; i++) { | for (i = 0; i < r->root_kq; i++) { |
| if (FD_ISSET(i, &rfd) || FD_ISSET(i, &xfd)) { | if (FD_ISSET(i, &rfd) || FD_ISSET(i, &xfd)) { |
| flg = 0; | flg = 0; |
| TAILQ_FOREACH_SAFE(task, &r->root_read, task_node, tmp) { | TAILQ_FOREACH_SAFE(t, &r->root_read, task_node, tmp) { |
| if (TASK_FD(task) != i) | if (TASK_FD(t) == i) { |
| continue; | if (!flg) |
| else { | task = t; |
| flg++; | flg++; |
| TASK_FLAG(task) = ioctl(TASK_FD(task), | |
| FIONREAD, &TASK_RET(task)); | |
| } | } |
| } | |
| if (flg && task) { | |
| TASK_FLAG(task) = ioctl(TASK_FD(task), FIONREAD, &TASK_RET(task)); | |
| /* remove read handle */ | /* remove read handle */ |
| remove_task_from(task, &r->root_read); | remove_task_from(task, &r->root_read); |
| Line 1206 fetch_hook_select_proceed(int en, fd_set rfd, fd_set w | Line 1212 fetch_hook_select_proceed(int en, fd_set rfd, fd_set w |
| task->task_type = taskREADY; | task->task_type = taskREADY; |
| insert_task_to(task, &r->root_ready); | insert_task_to(task, &r->root_ready); |
| } | } |
| } | |
| /* remove resouce */ | |
| if (flg) | |
| FD_CLR(i, &r->root_fds[0]); | |
| } | |
| if (FD_ISSET(i, &wfd)) { | /* remove resouce */ |
| if (flg == 1) | |
| FD_CLR(i, &r->root_fds[0]); | |
| } | |
| } else if (FD_ISSET(i, &wfd)) { | |
| flg = 0; | flg = 0; |
| TAILQ_FOREACH_SAFE(task, &r->root_write, task_node, tmp) { | TAILQ_FOREACH_SAFE(t, &r->root_write, task_node, tmp) { |
| if (TASK_FD(task) != i) | if (TASK_FD(t) == i) { |
| continue; | if (!flg) |
| else { | task = t; |
| flg++; | flg++; |
| TASK_FLAG(task) = ioctl(TASK_FD(task), | |
| FIONWRITE, &TASK_RET(task)); | |
| } | } |
| } | |
| if (flg && task) { | |
| TASK_FLAG(task) = ioctl(TASK_FD(task), FIONWRITE, &TASK_RET(task)); | |
| /* remove write handle */ | /* remove write handle */ |
| remove_task_from(task, &r->root_write); | remove_task_from(task, &r->root_write); |
| Line 1237 fetch_hook_select_proceed(int en, fd_set rfd, fd_set w | Line 1245 fetch_hook_select_proceed(int en, fd_set rfd, fd_set w |
| task->task_type = taskREADY; | task->task_type = taskREADY; |
| insert_task_to(task, &r->root_ready); | insert_task_to(task, &r->root_ready); |
| } | } |
| /* remove resouce */ | |
| if (flg == 1) | |
| FD_CLR(i, &r->root_fds[1]); | |
| } | } |
| /* remove resouce */ | |
| if (flg) | |
| FD_CLR(i, &r->root_fds[1]); | |
| } | } |
| } | } |