Keep the proc locked while we set PS_INMEM so that either of the proc lock
or sched_lock are sufficient to test this flag. XXX: vinum should really be using a kernel process via kthread_create() instead of this hack. I'm not even sure PS_INMEM can be clear at this point anyways.
This commit is contained in:
parent
70b4ddbb09
commit
7b5e3e1239
@ -71,10 +71,10 @@ vinum_daemon(void)
|
||||
|
||||
PROC_LOCK(curproc);
|
||||
curproc->p_flag |= P_SYSTEM; /* we're a system process */
|
||||
PROC_UNLOCK(curproc);
|
||||
mtx_lock_spin(&sched_lock);
|
||||
curproc->p_sflag |= PS_INMEM;
|
||||
mtx_unlock_spin(&sched_lock);
|
||||
PROC_UNLOCK(curproc);
|
||||
daemon_save_config(); /* start by saving the configuration */
|
||||
daemonpid = curproc->p_pid; /* mark our territory */
|
||||
while (1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user