Merge branch 'master' of gitlab.com:gabrielepmattia/aosv18-fiber

parents 607e07e7 293ad512
......@@ -174,8 +174,11 @@ typedef struct fibered_process {
pid_t pid; /**< the pid of the main thread, so the tgid of every thread of the process */
fibers_list_t fibers_list; /**< A list of fibers created in the process environment (so by any
thread in it) */
struct hlist_node hlist; /**< Hashlist implementation structure */
struct list_head list; /**< List implementation structure */
#ifdef USE_HASH_LIST
struct hlist_node hlist; /**< Hashlist implementation structure */
#else
struct list_head list; /**< List implementation structure */
#endif
} fibered_process_node_t;
/**
......@@ -186,8 +189,11 @@ typedef struct fibered_process {
*
*/
typedef struct fibered_processes_list {
#ifdef USE_HASH_LIST
DECLARE_HASHTABLE(hash_table, HASH_KEY_SIZE);
#else
struct list_head list;
#endif
unsigned processes_count; /**< The number of elements in the list */
} fibered_processes_list_t;
......
......@@ -40,7 +40,7 @@ static struct kprobe kp;
*/
// clang-format off
fibered_processes_list_t fibered_processes_list = {
#ifdef USE_HASH_TABLE
#ifdef USE_HASH_LIST
.hash_table = {[0 ...((1 << (HASH_KEY_SIZE)) - 1)] = HLIST_HEAD_INIT},
#else
.list = LIST_HEAD_INIT(fibered_processes_list.list),
......@@ -643,7 +643,7 @@ err_precheck:
* # Implementation
* For checking if the process is a fiber we need to find in the the @fibered_processes_list data
* structure. This module implements the list of fibered process both as a linked structure than an
* hash table. If `#define USE_HASH_TABLE` is present the hash table is used for checking if the
* hash table. If `#define USE_HASH_LIST` is present the hash table is used for checking if the
* process is fibered, this means that the macro @ref check_if_exists_hash (that relies on kernel
* built-in function `hash_for_each_possible_safe`) is used, otherwise we loop in a the linked list
* of fibered processes by using the macro @ref check_if_exists (that relies on
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment