diff options
author | dillon <dillon@FreeBSD.org> | 2001-09-01 03:54:09 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2001-09-01 03:54:09 +0000 |
commit | 4b176348af3a6195dec819c91beb8858dbd7ee9b (patch) | |
tree | a1c0042c4e9e8bde7cd36f1eb082d1a09d5c1d10 /sys/kern/kern_synch.c | |
parent | d1a6cbe1d59ffdd8715479fc5ceb20e567812005 (diff) | |
download | FreeBSD-src-4b176348af3a6195dec819c91beb8858dbd7ee9b.zip FreeBSD-src-4b176348af3a6195dec819c91beb8858dbd7ee9b.tar.gz |
Make yield() MPSAFE.
Synchronize syscalls.master with all MPSAFE changes to date. Synchronize
new syscall generation follows because yield() will panic if it is out
of sync with syscalls.master.
Diffstat (limited to 'sys/kern/kern_synch.c')
-rw-r--r-- | sys/kern/kern_synch.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index fa6c150..24da6e9 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -846,17 +846,22 @@ schedclock(p) int yield(struct proc *p, struct yield_args *uap) { - p->p_retval[0] = 0; mtx_lock_spin(&sched_lock); + mtx_assert(&Giant, MA_NOTOWNED); +#if 0 DROP_GIANT_NOSWITCH(); +#endif p->p_pri.pri_level = PRI_MAX_TIMESHARE; setrunqueue(p); p->p_stats->p_ru.ru_nvcsw++; mi_switch(); mtx_unlock_spin(&sched_lock); +#if 0 PICKUP_GIANT(); +#endif return (0); } + |