summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/init_main.c1
-rw-r--r--sys/kern/kern_exit.c1
-rw-r--r--sys/kern/kern_fork.c1
-rw-r--r--sys/sys/proc.h1
4 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index c6110fa..81cde0d 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -285,6 +285,7 @@ proc0_init(void *dummy __unused)
/*
* Create process 0 (the swapper).
*/
+ mtx_init(&p->p_mtx, "process lock", MTX_DEF);
LIST_INSERT_HEAD(&allproc, p, p_list);
p->p_pgrp = &pgrp0;
LIST_INSERT_HEAD(PGRPHASH(0), &pgrp0, pg_hash);
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 69f526c..ce3cc21 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -539,6 +539,7 @@ loop:
* release while still running in process context.
*/
cpu_wait(p);
+ mtx_destroy(&p->p_mtx);
zfree(proc_zone, p);
nprocs--;
return (0);
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 6caa1d2..6d9c6c1 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -367,6 +367,7 @@ again:
bcopy(&p1->p_startcopy, &p2->p_startcopy,
(unsigned) ((caddr_t)&p2->p_endcopy - (caddr_t)&p2->p_startcopy));
+ mtx_init(&p2->p_mtx, "process lock", MTX_DEF);
p2->p_aioinfo = NULL;
/*
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index 562dd09..1cb164b 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -193,6 +193,7 @@ struct proc {
struct vnode *p_textvp; /* Vnode of executable. */
char p_lock; /* Process lock (prevent swap) count. */
+ struct mtx p_mtx; /* Process stucture lock. */
u_char p_oncpu; /* Which cpu we are on */
u_char p_lastcpu; /* Last cpu we were on */
char p_rqindex; /* Run queue index */
OpenPOWER on IntegriCloud