diff options
author | jake <jake@FreeBSD.org> | 2000-12-02 05:41:30 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2000-12-02 05:41:30 +0000 |
commit | 7cd1ca1cdc2a023b31dfaf2d4f72702783bb2df2 (patch) | |
tree | 5c35469f7c7fe96ca4465df67615f5ca91b69401 /sys/kern/kern_synch.c | |
parent | 8fe9172d6420bac1642896608d1587e714c60453 (diff) | |
download | FreeBSD-src-7cd1ca1cdc2a023b31dfaf2d4f72702783bb2df2.zip FreeBSD-src-7cd1ca1cdc2a023b31dfaf2d4f72702783bb2df2.tar.gz |
Remove thr_sleep and thr_wakeup. Remove fields p_nthread and p_wakeup
from struct proc, which are now unused (p_nthread already was).
Remove process flag P_KTHREADP which was untested and only set
in vfs_aio.c (it should use kthread_create). Move the yield
system call to kern_synch.c as kern_threads.c has been removed
completely.
moral support from: alfred, jhb
Diffstat (limited to 'sys/kern/kern_synch.c')
-rw-r--r-- | sys/kern/kern_synch.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index a14abb2..7c9b50b 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -52,6 +52,7 @@ #include <sys/resourcevar.h> #include <sys/vmmeter.h> #include <sys/sysctl.h> +#include <sys/sysproto.h> #include <vm/vm.h> #include <vm/vm_extern.h> #ifdef KTRACE @@ -1076,3 +1077,27 @@ schedclock(p) p->p_priority = p->p_usrpri; } } + +/* + * General purpose yield system call + */ +int +yield(struct proc *p, struct yield_args *uap) +{ + int s; + + p->p_retval[0] = 0; + + s = splhigh(); + mtx_enter(&sched_lock, MTX_SPIN); + DROP_GIANT_NOSWITCH(); + p->p_priority = MAXPRI; + setrunqueue(p); + p->p_stats->p_ru.ru_nvcsw++; + mi_switch(); + mtx_exit(&sched_lock, MTX_SPIN); + PICKUP_GIANT(); + splx(s); + + return (0); +} |