1THREADGROUP_LOCK(9) Driver Basics THREADGROUP_LOCK(9)
2
3
4
6 threadgroup_lock - lock threadgroup
7
9 void threadgroup_lock(struct task_struct * tsk);
10
12 tsk
13 member task of the threadgroup to lock
14
16 Lock the threadgroup tsk belongs to. No new task is allowed to enter
17 and member tasks aren't allowed to exit (as indicated by PF_EXITING) or
18 change ->group_leader/pid. This is useful for cases where the
19 threadgroup needs to stay stable across blockable operations.
20
21 fork and exit paths explicitly call threadgroup_change_{begin|end}()
22 for synchronization. While held, no new task will be added to
23 threadgroup and no existing live task will have its PF_EXITING set.
24
25 de_thread does threadgroup_change_{begin|end}() when a non-leader
26 sub-thread becomes a new leader.
27
29Kernel Hackers Manual 3.10 June 2019 THREADGROUP_LOCK(9)