threadgroup_lock(9)

threadgroup_lock9

Lock threadgroup

Usage

void threadgroup_lock(struct task_struct * tsk);

Arguments

tsk

member task of the threadgroup to lock

Overview

Lock the threadgroup tsk belongs to. No new task is allowed to enter and member tasks aren't allowed to exit (as indicated by PF_EXITING) or change ->group_leader/pid. This is useful for cases where the threadgroup needs to stay stable across blockable operations.

fork and exit paths explicitly call threadgroup_change_{begin|end}() for synchronization. While held, no new task will be added to threadgroup and no existing live task will have its PF_EXITING set.

de_thread does threadgroup_change_{begin|end}() when a non-leader sub-thread becomes a new leader.

From linux-manual-3.16 3.16.56-1+deb8u1 in Debian 8 (Jessie). Parsed by carta from the page's man source.