Commit e93566c7 authored by Pavel Emelyanov's avatar Pavel Emelyanov

rst: Write comment about why we need two calls to restore_pgid

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 4c83c432
...@@ -1191,6 +1191,15 @@ static int restore_task_with_children(void *_arg) ...@@ -1191,6 +1191,15 @@ static int restore_task_with_children(void *_arg)
if (create_children_and_session()) if (create_children_and_session())
exit(1); exit(1);
/*
* Unlike sessions, process groups (a.k.a. pgids) can be joined
* by any task, provided the task with pid == pgid (group leader)
* exists. Thus, in order to restore pgid we must make sure that
* group leader was born (stage barrier below), created the group
* (the 1st restore_pgid below) and then join one (the 2nd call
* to restore_pgid).
*/
if (current->pgid == current->pid.virt) if (current->pgid == current->pid.virt)
restore_pgid(); restore_pgid();
......
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