Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6334

Why we need wait_queue_head_t, isn't wait_queue_t is already a list?

$
0
0

In use case, we can see

void add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait)

We add wait_queue_t to a wait_queue_head_t.

I don't understand, the wait_queue_t is already contained a list_head:

struct list_head task_list;

that means we don't need wait_queue_head_t and still can make a link list of wait_queue_t.

In this case, why we need wait_queue_head_t? what's the usage here?

By the way, it is in my mind, a similar issue:why sibling list is used to get the task_struct while fetching the children of a process

Why store sibling list in list_head of children? isn't sibling itself already a list?


Viewing all articles
Browse latest Browse all 6334

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>