Commit the better version that I had a while ago. This has only one
reference to curthread. (#define curproc (curthread->td_proc)).
This commit is contained in:
parent
5b1927bc01
commit
658c434d90
@ -119,14 +119,17 @@ kthread_create(void (*func)(void *), void *arg,
|
||||
void
|
||||
kthread_exit(int ecode)
|
||||
{
|
||||
struct proc *p = curproc;
|
||||
struct thread *td;
|
||||
struct proc *p;
|
||||
|
||||
td = curthread;
|
||||
p = td->td_proc;
|
||||
sx_xlock(&proctree_lock);
|
||||
PROC_LOCK(p);
|
||||
proc_reparent(p, initproc);
|
||||
PROC_UNLOCK(p);
|
||||
sx_xunlock(&proctree_lock);
|
||||
exit1(curthread, W_EXITCODE(ecode, 0));
|
||||
exit1(td, W_EXITCODE(ecode, 0));
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user