Subject: CVS commit: syssrc
To: None <source-changes@netbsd.org>
From: Manuel BOUYER <bouyer@netbsd.org>
List: source-changes
Date: 08/31/2000 17:36:23
Module Name:	syssrc
Committed By:	bouyer
Date:		Thu Aug 31 14:36:22 UTC 2000

Modified Files:
	syssrc/sys/compat/svr4: svr4_lwp.c
	syssrc/sys/kern: kern_synch.c
	syssrc/sys/sys: proc.h

Log Message:
Add the sched_suspend/sched_resume functions, as discussed on tech-kern,
with the following modifications to the initial patch:
- rename SHOLD and P_HOST to SSUSPEND and P_SUSPEND to avoid confusion with
  PHOLD()
- don't deal with SSUSPEND/P_SUSPEND in fork1(), if we come here while
  scheduler is suspended we're forking proc0, which can't have P_SUSPEND set.

sched_suspend() suspends the scheduling of users process, by removing all
processes from the run queues and changing their state from SRUN to
SSUSPEND. Also mark all user process but curproc P_SUSPEND.
When a process has to be put in SRUN and is marked P_SUSPEND, it's placed in
the SSUSPEND state instead.
sched_resume() places all SSUSPEND processes back in SRUN, clear the P_SUSPEND
flag.


To generate a diff of this commit:
cvs rdiff -r1.3 -r1.4 syssrc/sys/compat/svr4/svr4_lwp.c
cvs rdiff -r1.90 -r1.91 syssrc/sys/kern/kern_synch.c
cvs rdiff -r1.102 -r1.103 syssrc/sys/sys/proc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.