static void _wake_up_common(wait_queue_head_t *q, unsigned int mode, int nr_exclusive, int sync, void *key)

18However, some care is required when doing this because finished_wait is invoked from many places and the task could have been removed by the wake-up function. However, the kernel manages to get everything right by careful manipulation of the list elements.

q selects the desired wait queue and mode specifies what state processes may have in order to be woken up. nr_exclusive indicates how many tasks with a set wq_flag_exclusive are to be woken up.

The kernel then iterates through the sleeping tasks and invokes their wake-up function func:

Continue reading here: Kernelschedc

Was this article helpful?

0 0