![]() |
Helixis 1.0
Task Programming API
|
Go to the source code of this file.
Functions | |
void | hlx_list_construct (hlx_list *list) |
void | hlx_list_destruct (hlx_list *list) |
hlx_list_node * | hlx_list_push_front (hlx_list *list, void *data) |
hlx_list_node * | hlx_list_push_back (hlx_list *list, void *data) |
hlx_list_node * | hlx_list_find (const hlx_list *list, void *data) |
hlx_list_node * | hlx_list_get (const hlx_list *list, unsigned int pos) |
void | hlx_list_erase (hlx_list *list, hlx_list_node *node) |
void | hlx_list_clear (hlx_list *list) |
void | hlx_list_clear_data (hlx_list *list) |
unsigned int | hlx_list_empty (const hlx_list *list) |
unsigned int | hlx_listsize (const hlx_list *list) |
Variables | |
hlx_api | gl_api |
void hlx_list_clear | ( | hlx_list * | 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 * | 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 * | 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().
void hlx_list_destruct | ( | hlx_list * | list | ) |
unsigned int hlx_list_empty | ( | const hlx_list * | list | ) |
void hlx_list_erase | ( | hlx_list * | list, |
hlx_list_node * | 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 * | list, |
void * | data | ||
) |
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 * | list, |
unsigned int | pos | ||
) |
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 * | list, |
void * | data | ||
) |
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 * | list, |
void * | data | ||
) |
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); }
unsigned int hlx_listsize | ( | const hlx_list * | list | ) |