![]() |
Helixis 1.0
Task Programming API
|
Go to the source code of this file.
Data Structures | |
| struct | _hlx_list_node |
| struct | hlx_list |
Typedefs | |
| typedef struct _hlx_list_node | hlx_list_node |
Functions | |
| void | hlx_list_construct (hlx_list *) |
| void | hlx_list_destruct (hlx_list *) |
| hlx_list_node * | hlx_list_push_front (hlx_list *, void *) |
| hlx_list_node * | hlx_list_push_back (hlx_list *, void *) |
| hlx_list_node * | hlx_list_find (const hlx_list *, void *) |
| hlx_list_node * | hlx_list_get (const hlx_list *, unsigned int) |
| void | hlx_list_erase (hlx_list *, hlx_list_node *) |
| void | hlx_list_clear (hlx_list *) |
| void | hlx_list_clear_data (hlx_list *) |
| unsigned int | hlx_list_empty (const hlx_list *) |
| typedef struct _hlx_list_node hlx_list_node |
| void hlx_list_clear | ( | hlx_list * | ) |
Definition at line 152 of file list.c.
References hlx_api::atomic_decr_entry, hlx_list::first, hlx_api::free_entry, hlx_list::last, _hlx_list_node::next, and hlx_list::size.
Referenced by hlx_group_destruct(), hlx_list_destruct(), and hlx_scheduler_destruct().
{
hlx_list_node* it;
hlx_list_node* tmp;
it = list->first;
while (it)
{
tmp = it;
it = it->next;
gl_api.free_entry(tmp);
#ifdef HLX_BUILD_WITH_PARALLEL_THREADING
gl_api.atomic_decr_entry(&list->size);
#else
--list->size;
#endif
}
list->first = 0;
list->last = 0;
}
| void hlx_list_clear_data | ( | hlx_list * | ) |
Definition at line 173 of file list.c.
References hlx_api::atomic_decr_entry, _hlx_list_node::data, hlx_list::first, hlx_api::free_entry, hlx_list::last, _hlx_list_node::next, and hlx_list::size.
{
hlx_list_node* it;
hlx_list_node* tmp;
it = list->first;
while (it)
{
tmp = it;
it = it->next;
gl_api.free_entry(tmp->data);
gl_api.free_entry(tmp);
#ifdef HLX_BUILD_WITH_PARALLEL_THREADING
gl_api.atomic_decr_entry(&list->size);
#else
--list->size;
#endif
}
list->first = 0;
list->last = 0;
}
| void hlx_list_construct | ( | hlx_list * | ) |
Definition at line 44 of file list.c.
References hlx_list::first, hlx_list::last, and hlx_list::size.
Referenced by hlx_group_construct(), and hlx_scheduler_construct().
{
list->first = 0;
list->last = 0;
list->size = 0;
}
| void hlx_list_destruct | ( | hlx_list * | ) |
| unsigned int hlx_list_empty | ( | const hlx_list * | ) |
| void hlx_list_erase | ( | hlx_list * | , |
| hlx_list_node * | |||
| ) |
Definition at line 125 of file list.c.
References hlx_api::atomic_decr_entry, hlx_list::first, hlx_api::free_entry, hlx_list::last, _hlx_list_node::next, and hlx_list::size.
Referenced by hlx_group_del_task(), hlx_scheduler_schedule_group(), and hlx_scheduler_schedule_group_threaded().
{
hlx_list_node* it;
hlx_list_node* prev;
for (it = list->first, prev = 0; it; it = it->next)
{
if (it == node)
{
if (!prev)
list->first = it->next;
else
prev->next = it->next;
if (!it->next)
list->last = prev;
gl_api.free_entry(node);
#ifdef HLX_BUILD_WITH_PARALLEL_THREADING
gl_api.atomic_decr_entry(&list->size);
#else
--list->size;
#endif
return;
}
prev = it;
}
}
| hlx_list_node* hlx_list_find | ( | const hlx_list * | , |
| void * | |||
| ) |
Definition at line 104 of file list.c.
References _hlx_list_node::data, hlx_list::first, and _hlx_list_node::next.
Referenced by hlx_group_del_task().
{
hlx_list_node* it;
for (it = list->first; it; it = it->next)
if (it->data == data)
break;
return (it);
}
| hlx_list_node* hlx_list_get | ( | const hlx_list * | , |
| unsigned | int | ||
| ) |
Definition at line 114 of file list.c.
References hlx_list::first, and _hlx_list_node::next.
{
hlx_list_node* it;
unsigned int i;
for (i = 0, it = list->first; it; it = it->next, ++i)
if (i == pos)
return (it);
return (0);
}
| hlx_list_node* hlx_list_push_back | ( | hlx_list * | , |
| void * | |||
| ) |
Definition at line 79 of file list.c.
References hlx_api::atomic_incr_entry, _hlx_list_node::data, hlx_list::first, hlx_list::last, hlx_api::malloc_entry, _hlx_list_node::next, _hlx_list_node::parent, and hlx_list::size.
Referenced by hlx_core_create_group(), hlx_group_add_task(), hlx_group_flush_task_buffer(), and hlx_scheduler_construct().
{
hlx_list_node* node;
hlx_list_node* tmp;
node = gl_api.malloc_entry(sizeof(*node));
if (node == 0)
return (0);
tmp = list->first;
node->data = data;
node->next = 0;
if (!list->last)
list->first = node;
else
list->last->next = node;
node->parent = list->last;
list->last = node;
#ifdef HLX_BUILD_WITH_PARALLEL_THREADING
gl_api.atomic_incr_entry(&list->size);
#else
++list->size;
#endif
return (list->last);
}
| hlx_list_node* hlx_list_push_front | ( | hlx_list * | , |
| void * | |||
| ) |
Definition at line 56 of file list.c.
References hlx_api::atomic_incr_entry, _hlx_list_node::data, hlx_list::first, hlx_list::last, hlx_api::malloc_entry, _hlx_list_node::next, _hlx_list_node::parent, and hlx_list::size.
{
hlx_list_node* node;
node = gl_api.malloc_entry(sizeof(*node));
if (node == 0)
return (0);
node->data = data;
node->next = list->first;
node->parent = 0;
if (!list->first)
list->last = node;
else
list->first->parent = node;
list->first = node;
#ifdef HLX_BUILD_WITH_PARALLEL_THREADING
gl_api.atomic_incr_entry(&list->size);
#else
++list->size;
#endif
return (list->first);
}
1.7.4