#define thread_group_leader(p) (p->pid == p->tgid)
-static inline void unhash_process(struct task_struct *p)
-{
- write_lock_irq(&tasklist_lock);
- nr_threads--;
- unhash_pid(p);
- REMOVE_LINKS(p);
- list_del(&p->thread_group);
- write_unlock_irq(&tasklist_lock);
-}
+extern void unhash_process(struct task_struct *p);
/* Protects ->fs, ->files, ->mm, and synchronises with wait4(). Nests inside tasklist_lock */
static inline void task_lock(struct task_struct *p)
int getrusage(struct task_struct *, int, struct rusage *);
+static inline void __unhash_process(struct task_struct *p)
+{
+ write_lock_irq(&tasklist_lock);
+ nr_threads--;
+ unhash_pid(p);
+ REMOVE_LINKS(p);
+ list_del(&p->thread_group);
+ p->pid = 0;
+ write_unlock_irq(&tasklist_lock);
+}
+
static void release_task(struct task_struct * p)
{
if (p == current)
current->cmaj_flt += p->maj_flt + p->cmaj_flt;
current->cnswap += p->nswap + p->cnswap;
sched_exit(p);
- p->pid = 0;
put_task_struct(p);
}
+/* we are using it only for SMP init */
+
+void unhash_process(struct task_struct *p)
+{
+ return __unhash_process(p);
+}
+
/*
* This checks not only the pgrp, but falls back on the pid if no
* satisfactory pgrp is found. I dunno - gdb doesn't work correctly