version 1.14.2.5, 2012/08/23 00:31:41
|
version 1.18, 2013/06/03 20:52:53
|
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 | Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 |
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 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 |
|
register int i = 0; |
struct aiocb **acbs; |
struct aiocb **acbs; |
#endif /* EVFILT_LIO */ |
#endif /* EVFILT_LIO */ |
#endif /* AIO_SUPPORT */ |
#endif /* AIO_SUPPORT */ |
Line 162 sched_hook_cancel(void *task, void *arg __unused)
|
Line 162 sched_hook_cancel(void *task, void *arg __unused)
|
#else |
#else |
EV_SET(&chg[0], TASK_VAL(t), EVFILT_SIGNAL, EV_DELETE, 0, 0, (void*) TASK_VAL(t)); |
EV_SET(&chg[0], TASK_VAL(t), EVFILT_SIGNAL, EV_DELETE, 0, 0, (void*) TASK_VAL(t)); |
#endif |
#endif |
|
/* restore signal */ |
|
signal(TASK_VAL(t), SIG_DFL); |
break; |
break; |
#ifdef AIO_SUPPORT |
#ifdef AIO_SUPPORT |
case taskAIO: |
case taskAIO: |
Line 209 sched_hook_cancel(void *task, void *arg __unused)
|
Line 211 sched_hook_cancel(void *task, void *arg __unused)
|
#endif |
#endif |
case taskTHREAD: |
case taskTHREAD: |
#ifdef HAVE_LIBPTHREAD |
#ifdef HAVE_LIBPTHREAD |
for (i = 0; i < MAX_TASK_MISS; i++) | pthread_cancel((pthread_t) TASK_VAL(t)); |
if (!pthread_cancel((pthread_t) TASK_VAL(t))) { | |
/* joinable thread */ | |
if (TASK_FLAG(t) == PTHREAD_CREATE_JOINABLE) | |
schedTask(TASK_ROOT(t), _sched_threadJoin, | |
TASK_ARG(t), TASK_VAL(t), | |
TASK_DATA(t), TASK_DATLEN(t)); | |
return NULL; | |
} | |
return (void*) -1; | |
#endif |
#endif |
default: |
default: |
return NULL; |
return NULL; |
Line 248 sched_hook_thread(void *task, void *arg)
|
Line 241 sched_hook_thread(void *task, void *arg)
|
|
|
sigfillset(&s); |
sigfillset(&s); |
pthread_sigmask(SIG_BLOCK, &s, &o); |
pthread_sigmask(SIG_BLOCK, &s, &o); |
if (pthread_create(&tid, (pthread_attr_t*) arg, | if ((errno = pthread_create(&tid, (pthread_attr_t*) arg, |
(void *(*)(void*)) TASK_FUNC(t), t)) { | (void *(*)(void*)) _sched_threadWrapper, t))) { |
LOGERR; |
LOGERR; |
pthread_sigmask(SIG_SETMASK, &o, NULL); |
pthread_sigmask(SIG_SETMASK, &o, NULL); |
return (void*) -1; |
return (void*) -1; |
} | } else |
| TASK_VAL(t) = (u_long) tid; |
|
|
if (!TASK_ISLOCKED(t)) |
if (!TASK_ISLOCKED(t)) |
TASK_LOCK(t); |
TASK_LOCK(t); |
|
|
TASK_VAL(t) = (u_long) tid; |
|
pthread_sigmask(SIG_SETMASK, &o, NULL); |
pthread_sigmask(SIG_SETMASK, &o, NULL); |
return NULL; |
return NULL; |
} |
} |
Line 455 sched_hook_signal(void *task, void *arg __unused)
|
Line 448 sched_hook_signal(void *task, void *arg __unused)
|
|
|
if (!t || !TASK_ROOT(t)) |
if (!t || !TASK_ROOT(t)) |
return (void*) -1; |
return (void*) -1; |
|
|
|
/* ignore signal */ |
|
signal(TASK_VAL(t), SIG_IGN); |
|
|
#ifdef __NetBSD__ |
#ifdef __NetBSD__ |
EV_SET(&chg[0], TASK_VAL(t), EVFILT_SIGNAL, EV_ADD, 0, 0, (intptr_t) TASK_VAL(t)); |
EV_SET(&chg[0], TASK_VAL(t), EVFILT_SIGNAL, EV_ADD, 0, 0, (intptr_t) TASK_VAL(t)); |