From 9a4e2a07a8235ef5d01865b7802dd8149eeb6058 Mon Sep 17 00:00:00 2001 From: dillon Date: Mon, 12 Nov 2001 08:42:20 +0000 Subject: [PATCH] When curproc is used repeatedly store curproc into a local variable to reduce generated code. This is a test case. --- sys/kern/kern_kthread.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_kthread.c b/sys/kern/kern_kthread.c index cb715da5ffe3..becfb76785c5 100644 --- a/sys/kern/kern_kthread.c +++ b/sys/kern/kern_kthread.c @@ -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)); }