version 1.24.4.5, 2014/01/28 10:37:19
|
version 1.27.2.3, 2014/05/21 22:09:01
|
Line 12 terms:
|
Line 12 terms:
|
All of the documentation and software included in the ELWIX and AITNET |
All of the documentation and software included in the ELWIX and AITNET |
Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
|
|
Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 | Copyright 2004 - 2014 |
by Michael Pounov <misho@elwix.org>. All rights reserved. |
by Michael Pounov <misho@elwix.org>. All rights reserved. |
|
|
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
Line 62 sched_hook_init(void *root, void *arg __unused)
|
Line 62 sched_hook_init(void *root, void *arg __unused)
|
if (!r) |
if (!r) |
return (void*) -1; |
return (void*) -1; |
|
|
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
r->root_kq = kqueue(); |
r->root_kq = kqueue(); |
if (r->root_kq == -1) { |
if (r->root_kq == -1) { |
LOGERR; |
LOGERR; |
Line 92 sched_hook_fini(void *root, void *arg __unused)
|
Line 92 sched_hook_fini(void *root, void *arg __unused)
|
if (!r) |
if (!r) |
return (void*) -1; |
return (void*) -1; |
|
|
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
if (r->root_kq > 2) { |
if (r->root_kq > 2) { |
close(r->root_kq); |
close(r->root_kq); |
r->root_kq = 0; |
r->root_kq = 0; |
Line 117 void *
|
Line 117 void *
|
sched_hook_cancel(void *task, void *arg __unused) |
sched_hook_cancel(void *task, void *arg __unused) |
{ |
{ |
sched_task_t *t = task; |
sched_task_t *t = task; |
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
struct kevent chg[1]; |
struct kevent chg[1]; |
struct timespec timeout = { 0, 0 }; |
struct timespec timeout = { 0, 0 }; |
#else |
#else |
Line 134 sched_hook_cancel(void *task, void *arg __unused)
|
Line 134 sched_hook_cancel(void *task, void *arg __unused)
|
|
|
if (!t || !TASK_ROOT(t)) |
if (!t || !TASK_ROOT(t)) |
return (void*) -1; |
return (void*) -1; |
#ifdef KQ_DISABLE | #if SUP_ENABLE != KQ_ENABLE |
r = TASK_ROOT(t); |
r = TASK_ROOT(t); |
#endif |
#endif |
|
|
switch (TASK_TYPE(t)) { |
switch (TASK_TYPE(t)) { |
case taskREAD: |
case taskREAD: |
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
#ifdef __NetBSD__ |
#ifdef __NetBSD__ |
EV_SET(&chg[0], TASK_FD(t), EVFILT_READ, EV_DELETE, 0, 0, (intptr_t) TASK_FD(t)); |
EV_SET(&chg[0], TASK_FD(t), EVFILT_READ, EV_DELETE, 0, 0, (intptr_t) TASK_FD(t)); |
#else |
#else |
Line 158 sched_hook_cancel(void *task, void *arg __unused)
|
Line 158 sched_hook_cancel(void *task, void *arg __unused)
|
#endif |
#endif |
break; |
break; |
case taskWRITE: |
case taskWRITE: |
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
#ifdef __NetBSD__ |
#ifdef __NetBSD__ |
EV_SET(&chg[0], TASK_FD(t), EVFILT_WRITE, EV_DELETE, 0, 0, (intptr_t) TASK_FD(t)); |
EV_SET(&chg[0], TASK_FD(t), EVFILT_WRITE, EV_DELETE, 0, 0, (intptr_t) TASK_FD(t)); |
#else |
#else |
Line 176 sched_hook_cancel(void *task, void *arg __unused)
|
Line 176 sched_hook_cancel(void *task, void *arg __unused)
|
#endif |
#endif |
break; |
break; |
case taskALARM: |
case taskALARM: |
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
#ifdef __NetBSD__ |
#ifdef __NetBSD__ |
EV_SET(&chg[0], (uintptr_t) TASK_DATA(t), EVFILT_TIMER, EV_DELETE, |
EV_SET(&chg[0], (uintptr_t) TASK_DATA(t), EVFILT_TIMER, EV_DELETE, |
0, 0, (intptr_t) TASK_DATA(t)); |
0, 0, (intptr_t) TASK_DATA(t)); |
Line 187 sched_hook_cancel(void *task, void *arg __unused)
|
Line 187 sched_hook_cancel(void *task, void *arg __unused)
|
#endif |
#endif |
break; |
break; |
case taskNODE: |
case taskNODE: |
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
#ifdef __NetBSD__ |
#ifdef __NetBSD__ |
EV_SET(&chg[0], TASK_FD(t), EVFILT_VNODE, EV_DELETE, 0, 0, (intptr_t) TASK_FD(t)); |
EV_SET(&chg[0], TASK_FD(t), EVFILT_VNODE, EV_DELETE, 0, 0, (intptr_t) TASK_FD(t)); |
#else |
#else |
Line 196 sched_hook_cancel(void *task, void *arg __unused)
|
Line 196 sched_hook_cancel(void *task, void *arg __unused)
|
#endif |
#endif |
break; |
break; |
case taskPROC: |
case taskPROC: |
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
#ifdef __NetBSD__ |
#ifdef __NetBSD__ |
EV_SET(&chg[0], TASK_VAL(t), EVFILT_PROC, EV_DELETE, 0, 0, (intptr_t) TASK_VAL(t)); |
EV_SET(&chg[0], TASK_VAL(t), EVFILT_PROC, EV_DELETE, 0, 0, (intptr_t) TASK_VAL(t)); |
#else |
#else |
Line 205 sched_hook_cancel(void *task, void *arg __unused)
|
Line 205 sched_hook_cancel(void *task, void *arg __unused)
|
#endif |
#endif |
break; |
break; |
case taskSIGNAL: |
case taskSIGNAL: |
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
#ifdef __NetBSD__ |
#ifdef __NetBSD__ |
EV_SET(&chg[0], TASK_VAL(t), EVFILT_SIGNAL, EV_DELETE, 0, 0, (intptr_t) TASK_VAL(t)); |
EV_SET(&chg[0], TASK_VAL(t), EVFILT_SIGNAL, EV_DELETE, 0, 0, (intptr_t) TASK_VAL(t)); |
#else |
#else |
Line 217 sched_hook_cancel(void *task, void *arg __unused)
|
Line 217 sched_hook_cancel(void *task, void *arg __unused)
|
break; |
break; |
#ifdef AIO_SUPPORT |
#ifdef AIO_SUPPORT |
case taskAIO: |
case taskAIO: |
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
#ifdef __NetBSD__ |
#ifdef __NetBSD__ |
EV_SET(&chg[0], TASK_VAL(t), EVFILT_AIO, EV_DELETE, 0, 0, (intptr_t) TASK_VAL(t)); |
EV_SET(&chg[0], TASK_VAL(t), EVFILT_AIO, EV_DELETE, 0, 0, (intptr_t) TASK_VAL(t)); |
#else |
#else |
Line 234 sched_hook_cancel(void *task, void *arg __unused)
|
Line 234 sched_hook_cancel(void *task, void *arg __unused)
|
break; |
break; |
#ifdef EVFILT_LIO |
#ifdef EVFILT_LIO |
case taskLIO: |
case taskLIO: |
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
#ifdef __NetBSD__ |
#ifdef __NetBSD__ |
EV_SET(&chg[0], TASK_VAL(t), EVFILT_LIO, EV_DELETE, 0, 0, (intptr_t) TASK_VAL(t)); |
EV_SET(&chg[0], TASK_VAL(t), EVFILT_LIO, EV_DELETE, 0, 0, (intptr_t) TASK_VAL(t)); |
#else |
#else |
Line 256 sched_hook_cancel(void *task, void *arg __unused)
|
Line 256 sched_hook_cancel(void *task, void *arg __unused)
|
#endif /* AIO_SUPPORT */ |
#endif /* AIO_SUPPORT */ |
#ifdef EVFILT_USER |
#ifdef EVFILT_USER |
case taskUSER: |
case taskUSER: |
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
#ifdef __NetBSD__ |
#ifdef __NetBSD__ |
EV_SET(&chg[0], TASK_VAL(t), EVFILT_USER, EV_DELETE, 0, 0, (intptr_t) TASK_VAL(t)); |
EV_SET(&chg[0], TASK_VAL(t), EVFILT_USER, EV_DELETE, 0, 0, (intptr_t) TASK_VAL(t)); |
#else |
#else |
Line 267 sched_hook_cancel(void *task, void *arg __unused)
|
Line 267 sched_hook_cancel(void *task, void *arg __unused)
|
#endif /* EVFILT_USER */ |
#endif /* EVFILT_USER */ |
case taskTHREAD: |
case taskTHREAD: |
#ifdef HAVE_LIBPTHREAD |
#ifdef HAVE_LIBPTHREAD |
pthread_cancel((pthread_t) TASK_VAL(t)); | if (TASK_VAL(t)) |
| pthread_cancel((pthread_t) TASK_VAL(t)); |
#endif |
#endif |
return NULL; |
return NULL; |
#if defined(HAVE_TIMER_CREATE) && defined(HAVE_TIMER_SETTIME) | #if defined(HAVE_TIMER_CREATE) && defined(HAVE_TIMER_SETTIME) && defined(HAVE_TIMER_DELETE) |
case taskRTC: |
case taskRTC: |
timer_delete((timer_t) TASK_FLAG(t)); |
timer_delete((timer_t) TASK_FLAG(t)); |
schedCancel((sched_task_t*) TASK_RET(t)); |
schedCancel((sched_task_t*) TASK_RET(t)); |
Line 280 sched_hook_cancel(void *task, void *arg __unused)
|
Line 281 sched_hook_cancel(void *task, void *arg __unused)
|
return NULL; |
return NULL; |
} |
} |
|
|
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
kevent(TASK_ROOT(t)->root_kq, chg, 1, NULL, 0, &timeout); |
kevent(TASK_ROOT(t)->root_kq, chg, 1, NULL, 0, &timeout); |
#endif |
#endif |
return NULL; |
return NULL; |
Line 333 void *
|
Line 334 void *
|
sched_hook_read(void *task, void *arg __unused) |
sched_hook_read(void *task, void *arg __unused) |
{ |
{ |
sched_task_t *t = task; |
sched_task_t *t = task; |
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
struct kevent chg[1]; |
struct kevent chg[1]; |
struct timespec timeout = { 0, 0 }; |
struct timespec timeout = { 0, 0 }; |
#else |
#else |
Line 342 sched_hook_read(void *task, void *arg __unused)
|
Line 343 sched_hook_read(void *task, void *arg __unused)
|
|
|
if (!t || !TASK_ROOT(t)) |
if (!t || !TASK_ROOT(t)) |
return (void*) -1; |
return (void*) -1; |
#ifdef KQ_DISABLE | #if SUP_ENABLE != KQ_ENABLE |
r = TASK_ROOT(t); |
r = TASK_ROOT(t); |
#endif |
#endif |
|
|
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
#ifdef __NetBSD__ |
#ifdef __NetBSD__ |
EV_SET(&chg[0], TASK_FD(t), EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, (intptr_t) TASK_FD(t)); |
EV_SET(&chg[0], TASK_FD(t), EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, (intptr_t) TASK_FD(t)); |
#else |
#else |
Line 379 void *
|
Line 380 void *
|
sched_hook_write(void *task, void *arg __unused) |
sched_hook_write(void *task, void *arg __unused) |
{ |
{ |
sched_task_t *t = task; |
sched_task_t *t = task; |
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
struct kevent chg[1]; |
struct kevent chg[1]; |
struct timespec timeout = { 0, 0 }; |
struct timespec timeout = { 0, 0 }; |
#else |
#else |
Line 388 sched_hook_write(void *task, void *arg __unused)
|
Line 389 sched_hook_write(void *task, void *arg __unused)
|
|
|
if (!t || !TASK_ROOT(t)) |
if (!t || !TASK_ROOT(t)) |
return (void*) -1; |
return (void*) -1; |
#ifdef KQ_DISABLE | #if SUP_ENABLE != KQ_ENABLE |
r = TASK_ROOT(t); |
r = TASK_ROOT(t); |
#endif |
#endif |
|
|
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
#ifdef __NetBSD__ |
#ifdef __NetBSD__ |
EV_SET(&chg[0], TASK_FD(t), EVFILT_WRITE, EV_ADD | EV_CLEAR, 0, 0, (intptr_t) TASK_FD(t)); |
EV_SET(&chg[0], TASK_FD(t), EVFILT_WRITE, EV_ADD | EV_CLEAR, 0, 0, (intptr_t) TASK_FD(t)); |
#else |
#else |
Line 424 sched_hook_write(void *task, void *arg __unused)
|
Line 425 sched_hook_write(void *task, void *arg __unused)
|
void * |
void * |
sched_hook_alarm(void *task, void *arg __unused) |
sched_hook_alarm(void *task, void *arg __unused) |
{ |
{ |
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
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 }; |
Line 463 sched_hook_alarm(void *task, void *arg __unused)
|
Line 464 sched_hook_alarm(void *task, void *arg __unused)
|
void * |
void * |
sched_hook_node(void *task, void *arg __unused) |
sched_hook_node(void *task, void *arg __unused) |
{ |
{ |
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
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 }; |
Line 502 sched_hook_node(void *task, void *arg __unused)
|
Line 503 sched_hook_node(void *task, void *arg __unused)
|
void * |
void * |
sched_hook_proc(void *task, void *arg __unused) |
sched_hook_proc(void *task, void *arg __unused) |
{ |
{ |
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
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 }; |
Line 529 sched_hook_proc(void *task, void *arg __unused)
|
Line 530 sched_hook_proc(void *task, void *arg __unused)
|
return NULL; |
return NULL; |
} |
} |
|
|
#ifdef KQ_DISABLE |
|
static void |
|
_sched_sigHandler(int sig) |
|
{ |
|
} |
|
#endif /* KQ_DISABLE */ |
|
|
|
/* |
/* |
* sched_hook_signal() - Default SIGNAL hook |
* sched_hook_signal() - Default SIGNAL hook |
* |
* |
Line 546 _sched_sigHandler(int sig)
|
Line 540 _sched_sigHandler(int sig)
|
void * |
void * |
sched_hook_signal(void *task, void *arg __unused) |
sched_hook_signal(void *task, void *arg __unused) |
{ |
{ |
|
#if SUP_ENABLE == KQ_ENABLE |
sched_task_t *t = task; |
sched_task_t *t = task; |
#ifndef KQ_DISABLE |
|
struct kevent chg[1]; |
struct kevent chg[1]; |
struct timespec timeout = { 0, 0 }; |
struct timespec timeout = { 0, 0 }; |
|
|
Line 570 sched_hook_signal(void *task, void *arg __unused)
|
Line 564 sched_hook_signal(void *task, void *arg __unused)
|
return (void*) -1; |
return (void*) -1; |
} |
} |
#else |
#else |
|
#if 0 |
|
sched_task_t *t = task; |
struct sigaction sa; |
struct sigaction sa; |
|
|
memset(&sa, 0, sizeof sa); |
memset(&sa, 0, sizeof sa); |
Line 584 sched_hook_signal(void *task, void *arg __unused)
|
Line 580 sched_hook_signal(void *task, void *arg __unused)
|
LOGERR; |
LOGERR; |
return (void*) -1; |
return (void*) -1; |
} |
} |
|
#endif /* 0 */ |
#endif |
#endif |
return NULL; |
return NULL; |
} |
} |
Line 599 sched_hook_signal(void *task, void *arg __unused)
|
Line 596 sched_hook_signal(void *task, void *arg __unused)
|
void * |
void * |
sched_hook_user(void *task, void *arg __unused) |
sched_hook_user(void *task, void *arg __unused) |
{ |
{ |
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
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 }; |
Line 640 sched_hook_fetch(void *root, void *arg __unused)
|
Line 637 sched_hook_fetch(void *root, void *arg __unused)
|
sched_root_task_t *r = root; |
sched_root_task_t *r = root; |
sched_task_t *task, *tmp; |
sched_task_t *task, *tmp; |
struct timespec now, m, mtmp; |
struct timespec now, m, mtmp; |
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
struct kevent evt[1], res[KQ_EVENTS]; |
struct kevent evt[1], res[KQ_EVENTS]; |
struct timespec *timeout, m, mtmp; | struct timespec *timeout; |
#else |
#else |
struct timeval *timeout, tv; |
struct timeval *timeout, tv; |
|
fd_set rfd, wfd, xfd; |
#endif |
#endif |
register int i, flg; |
register int i, flg; |
int en; |
int en; |
Line 737 sched_hook_fetch(void *root, void *arg __unused)
|
Line 735 sched_hook_fetch(void *root, void *arg __unused)
|
sched_timespecclear(&r->root_wait); |
sched_timespecclear(&r->root_wait); |
|
|
if (r->root_wait.tv_sec != -1 && r->root_wait.tv_nsec != -1) { |
if (r->root_wait.tv_sec != -1 && r->root_wait.tv_nsec != -1) { |
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
timeout = &r->root_wait; |
timeout = &r->root_wait; |
#else |
#else |
sched_timespec2val(&r->root_wait, &tv); |
sched_timespec2val(&r->root_wait, &tv); |
timeout = &tv; |
timeout = &tv; |
#endif /* KQ_DISABLE */ | #endif /* KQ_SUPPORT */ |
} else if (sched_timespecisinf(&r->root_poll)) |
} else if (sched_timespecisinf(&r->root_poll)) |
timeout = NULL; |
timeout = NULL; |
else { |
else { |
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
timeout = &r->root_poll; |
timeout = &r->root_poll; |
#else |
#else |
sched_timespec2val(&r->root_poll, &tv); |
sched_timespec2val(&r->root_poll, &tv); |
timeout = &tv; |
timeout = &tv; |
#endif /* KQ_DISABLE */ | #endif /* KQ_SUPPORT */ |
} |
} |
|
|
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
if ((en = kevent(r->root_kq, NULL, 0, res, KQ_EVENTS, timeout)) == -1) { |
if ((en = kevent(r->root_kq, NULL, 0, res, KQ_EVENTS, timeout)) == -1) { |
#else |
#else |
if ((en = select(r->root_kq, &r->root_fds[0], &r->root_fds[1], | rfd = xfd = r->root_fds[0]; |
&r->root_fds[0], timeout)) == -1) { | wfd = r->root_fds[1]; |
#endif /* KQ_DISABLE */ | if ((en = select(r->root_kq, &rfd, &wfd, &xfd, timeout)) == -1) { |
| #endif /* KQ_SUPPORT */ |
if (r->root_hooks.hook_exec.exception) { |
if (r->root_hooks.hook_exec.exception) { |
if (r->root_hooks.hook_exec.exception(r, NULL)) |
if (r->root_hooks.hook_exec.exception(r, NULL)) |
return NULL; |
return NULL; |
Line 771 sched_hook_fetch(void *root, void *arg __unused)
|
Line 770 sched_hook_fetch(void *root, void *arg __unused)
|
/* kevent dispatcher */ |
/* kevent dispatcher */ |
now.tv_sec = now.tv_nsec = 0; |
now.tv_sec = now.tv_nsec = 0; |
/* Go and catch the cat into pipes ... */ |
/* Go and catch the cat into pipes ... */ |
#ifndef KQ_DISABLE | #if SUP_ENABLE == KQ_ENABLE |
for (i = 0; i < en; i++) { |
for (i = 0; i < en; i++) { |
memcpy(evt, &res[i], sizeof evt); |
memcpy(evt, &res[i], sizeof evt); |
evt->flags = EV_DELETE; |
evt->flags = EV_DELETE; |
Line 1144 sched_hook_fetch(void *root, void *arg __unused)
|
Line 1143 sched_hook_fetch(void *root, void *arg __unused)
|
} |
} |
#else /* end of kevent dispatcher */ |
#else /* end of kevent dispatcher */ |
for (i = 0; i < r->root_kq; i++) { |
for (i = 0; i < r->root_kq; i++) { |
if (FD_ISSET(i, &r->root_fds[0])) { | 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(task, &r->root_read, task_node, tmp) { |
if (TASK_FD(task) != i) |
if (TASK_FD(task) != i) |
continue; |
continue; |
else { |
else { |
flg++; |
flg++; |
TASK_RET(task) ^= TASK_RET(task); | TASK_FLAG(task) = ioctl(TASK_FD(task), |
TASK_FLAG(task) ^= TASK_FLAG(task); | FIONREAD, &TASK_RET(task)); |
} |
} |
/* remove read handle */ |
/* remove read handle */ |
#ifdef HAVE_LIBPTHREAD |
#ifdef HAVE_LIBPTHREAD |
Line 1198 sched_hook_fetch(void *root, void *arg __unused)
|
Line 1197 sched_hook_fetch(void *root, void *arg __unused)
|
FD_CLR(i, &r->root_fds[0]); |
FD_CLR(i, &r->root_fds[0]); |
} |
} |
|
|
if (FD_ISSET(i, &r->root_fds[1])) { | if (FD_ISSET(i, &wfd)) { |
flg = 0; |
flg = 0; |
TAILQ_FOREACH_SAFE(task, &r->root_write, task_node, tmp) { |
TAILQ_FOREACH_SAFE(task, &r->root_write, task_node, tmp) { |
if (TASK_FD(task) != i) |
if (TASK_FD(task) != i) |
continue; |
continue; |
else { |
else { |
flg++; |
flg++; |
TASK_RET(task) ^= TASK_RET(task); | TASK_FLAG(task) = ioctl(TASK_FD(task), |
TASK_FLAG(task) ^= TASK_FLAG(task); | FIONWRITE, &TASK_RET(task)); |
} |
} |
/* remove write handle */ |
/* remove write handle */ |
#ifdef HAVE_LIBPTHREAD |
#ifdef HAVE_LIBPTHREAD |
Line 1259 sched_hook_fetch(void *root, void *arg __unused)
|
Line 1258 sched_hook_fetch(void *root, void *arg __unused)
|
break; |
break; |
if (i > 2) |
if (i > 2) |
r->root_kq = i + 1; |
r->root_kq = i + 1; |
#endif /* KQ_DISABLE */ | #endif /* KQ_SUPPORT */ |
|
|
skip_event: |
skip_event: |
/* timer update & put in ready queue */ |
/* timer update & put in ready queue */ |
Line 1389 sched_hook_condition(void *root, void *arg)
|
Line 1388 sched_hook_condition(void *root, void *arg)
|
* @arg = unused |
* @arg = unused |
* return: <0 errors and 0 ok |
* return: <0 errors and 0 ok |
*/ |
*/ |
#if defined(HAVE_TIMER_CREATE) && defined(HAVE_TIMER_SETTIME) | #if defined(HAVE_TIMER_CREATE) && defined(HAVE_TIMER_SETTIME) && defined(HAVE_TIMER_DELETE) |
void * |
void * |
sched_hook_rtc(void *task, void *arg __unused) |
sched_hook_rtc(void *task, void *arg __unused) |
{ |
{ |