提交 c1df7fb8 编写于 作者: O Oleg Nesterov 提交者: Linus Torvalds

[PATCH] cleanup next_tid()

Try to make next_tid() a bit more readable and deletes unnecessary
"pid_alive(pos)" check.
Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 a872ff0c
......@@ -2267,15 +2267,15 @@ static struct task_struct *first_tid(struct task_struct *leader,
*/
static struct task_struct *next_tid(struct task_struct *start)
{
struct task_struct *pos;
struct task_struct *pos = NULL;
rcu_read_lock();
pos = start;
if (pid_alive(start))
if (pid_alive(start)) {
pos = next_thread(start);
if (pid_alive(pos) && (pos != start->group_leader))
get_task_struct(pos);
else
pos = NULL;
if (thread_group_leader(pos))
pos = NULL;
else
get_task_struct(pos);
}
rcu_read_unlock();
put_task_struct(start);
return pos;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册