When curproc is used repeatedly store curproc into a local

variable to reduce generated code.  This is a test case.
This commit is contained in:
Matthew Dillon 2001-11-12 08:42:20 +00:00
parent c35a41320d
commit 5b1927bc01
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=86292

View File

@ -119,11 +119,12 @@ kthread_create(void (*func)(void *), void *arg,
void
kthread_exit(int ecode)
{
struct proc *p = curproc;
sx_xlock(&proctree_lock);
PROC_LOCK(curproc);
proc_reparent(curproc, initproc);
PROC_UNLOCK(curproc);
PROC_LOCK(p);
proc_reparent(p, initproc);
PROC_UNLOCK(p);
sx_xunlock(&proctree_lock);
exit1(curthread, W_EXITCODE(ecode, 0));
}