---
name: "threadgroup_lock"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/threadgroup_lock"
---

# threadgroup\_lock(9)

lock threadgroup

## NAME

threadgroup\_lock - lock threadgroup

## SYNOPSIS

**void threadgroup\_lock(struct task\_struct \*** *tsk***);**

## ARGUMENTS

*tsk*

member task of the threadgroup to lock

## DESCRIPTION

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.

## COPYRIGHT
