version 1.5.2.3, 2012/05/10 14:44:22
|
version 1.5.2.4, 2012/05/10 15:30:18
|
Line 212 void *
|
Line 212 void *
|
sched_hook_fetch(void *root, void *arg __unused) |
sched_hook_fetch(void *root, void *arg __unused) |
{ |
{ |
sched_root_task_t *r = root; |
sched_root_task_t *r = root; |
sched_task_t *task; | sched_task_t *task, *tmp; |
struct timespec now, m, mtmp; |
struct timespec now, m, mtmp; |
struct timespec *timeout; |
struct timespec *timeout; |
struct kevent evt[1], res[KQ_EVENTS]; |
struct kevent evt[1], res[KQ_EVENTS]; |
Line 318 sched_hook_fetch(void *root, void *arg __unused)
|
Line 318 sched_hook_fetch(void *root, void *arg __unused)
|
/* Put read/write task to ready queue */ |
/* Put read/write task to ready queue */ |
switch (res[i].filter) { |
switch (res[i].filter) { |
case EVFILT_READ: |
case EVFILT_READ: |
TAILQ_FOREACH(task, &r->root_read, task_node) { | 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; |
continue; |
/* remove read handle */ |
/* remove read handle */ |
Line 363 sched_hook_fetch(void *root, void *arg __unused)
|
Line 363 sched_hook_fetch(void *root, void *arg __unused)
|
} |
} |
break; |
break; |
case EVFILT_WRITE: |
case EVFILT_WRITE: |
TAILQ_FOREACH(task, &r->root_write, task_node) { | 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; |
continue; |
/* remove write handle */ |
/* remove write handle */ |
Line 420 sched_hook_fetch(void *root, void *arg __unused)
|
Line 420 sched_hook_fetch(void *root, void *arg __unused)
|
/* timer update & put in ready queue */ |
/* timer update & put in ready queue */ |
clock_gettime(CLOCK_MONOTONIC, &now); |
clock_gettime(CLOCK_MONOTONIC, &now); |
|
|
TAILQ_FOREACH(task, &r->root_timer, task_node) | TAILQ_FOREACH_SAFE(task, &r->root_timer, task_node, tmp) |
if (sched_timespeccmp(&now, &TASK_TS(task), -) >= 0) { |
if (sched_timespeccmp(&now, &TASK_TS(task), -) >= 0) { |
#ifdef HAVE_LIBPTHREAD |
#ifdef HAVE_LIBPTHREAD |
pthread_mutex_lock(&r->root_mtx[taskTIMER]); |
pthread_mutex_lock(&r->root_mtx[taskTIMER]); |