kernel: rename is_single_threaded(task) to current_is_single_threaded(void)

- is_single_threaded(task) is not safe unless task == current,
  we can't use task->signal or task->mm.

- it doesn't make sense unless task == current, the task can
  fork right after the check.

Rename it to current_is_single_threaded() and kill the argument.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
Oleg Nesterov
2009-07-10 03:48:23 +02:00
committed by James Morris
parent d2e3ee9b29
commit 5bb459bb45
4 changed files with 5 additions and 4 deletions

View File

@@ -15,8 +15,9 @@
/*
* Returns true if the task does not share ->mm with another thread/process.
*/
bool is_single_threaded(struct task_struct *task)
bool current_is_single_threaded(void)
{
struct task_struct *task = current;
struct mm_struct *mm = task->mm;
struct task_struct *p, *t;
bool ret;