|
version 1.26, 2015/07/02 22:45:00
|
version 1.26.12.1, 2018/08/20 12:03: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 - 2015 | Copyright 2004 - 2018 |
| 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 255 schedNode(sched_root_task_t * __restrict root, sched_t
|
Line 255 schedNode(sched_root_task_t * __restrict root, sched_t
|
| |
|
| if (root->root_hooks.hook_add.node) |
if (root->root_hooks.hook_add.node) |
| ptr = root->root_hooks.hook_add.node(task, NULL); |
ptr = root->root_hooks.hook_add.node(task, NULL); |
| |
else |
| |
ptr = NULL; |
| |
|
| |
if (!ptr) |
| |
insert_task_to(task, &root->root_node); |
| |
else |
| |
task = sched_unuseTask(task); |
| |
|
| |
return task; |
| |
#endif /* KQ_SUPPORT */ |
| |
} |
| |
|
| |
/* |
| |
* schedNode2() - Add NODE task with all events to scheduler queue |
| |
* |
| |
* @root = root task |
| |
* @func = task execution function |
| |
* @arg = 1st func argument |
| |
* @fd = fd handle |
| |
* @opt_data = Optional data |
| |
* @opt_dlen = Optional data length |
| |
* return: NULL error or !=NULL new queued task |
| |
*/ |
| |
sched_task_t * |
| |
schedNode2(sched_root_task_t * __restrict root, sched_task_func_t func, void *arg, int fd, |
| |
void *opt_data, size_t opt_dlen) |
| |
{ |
| |
#if SUP_ENABLE != KQ_SUPPORT |
| |
sched_SetErr(ENOTSUP, "disabled kqueue support"); |
| |
return NULL; |
| |
#else |
| |
sched_task_t *task; |
| |
void *ptr; |
| |
|
| |
if (!root || !func) |
| |
return NULL; |
| |
|
| |
/* get new task */ |
| |
if (!(task = sched_useTask(root))) |
| |
return NULL; |
| |
|
| |
TASK_FUNC(task) = func; |
| |
TASK_TYPE(task) = taskNODE; |
| |
TASK_ROOT(task) = root; |
| |
|
| |
TASK_ARG(task) = arg; |
| |
TASK_FD(task) = fd; |
| |
|
| |
TASK_DATA(task) = opt_data; |
| |
TASK_DATLEN(task) = opt_dlen; |
| |
|
| |
if (root->root_hooks.hook_add.node) |
| |
ptr = root->root_hooks.hook_add.node(task, |
| |
(void*) (NOTE_READ | NOTE_CLOSE_WRITE | NOTE_CLOSE | NOTE_OPEN)); |
| else |
else |
| ptr = NULL; |
ptr = NULL; |
| |
|