aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index e194ec75833d..e3539c14e47e 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1209,9 +1209,10 @@ extern void wait_task_inactive(task_t * p);
#define while_each_thread(g, t) \
while ((t = next_thread(t)) != g)
-#define thread_group_leader(p) (p->pid == p->tgid)
+/* de_thread depends on thread_group_leader not being a pid based check */
+#define thread_group_leader(p) (p == p->group_leader)
-static inline task_t *next_thread(task_t *p)
+static inline task_t *next_thread(const task_t *p)
{
return list_entry(rcu_dereference(p->thread_group.next),
task_t, thread_group);