1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-02 12:20:51 +00:00

- Give minclsyspri and maxclsyspri real values (consulted with kmacy).

- Honour 'pri' argument for thread_create().
This commit is contained in:
Pawel Jakub Dawidek 2009-08-23 11:22:46 +00:00
parent 3471c35ded
commit 1869987e42
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=196456
2 changed files with 16 additions and 4 deletions

View File

@ -32,9 +32,9 @@
#ifdef _KERNEL
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/lock.h>
#include_next <sys/mutex.h>
#include <sys/proc.h>
#include <sys/sx.h>
typedef enum {

View File

@ -34,13 +34,16 @@
#include_next <sys/proc.h>
#include <sys/stdint.h>
#include <sys/smp.h>
#include <sys/sched.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/debug.h>
#ifdef _KERNEL
#define CPU curcpu
#define minclsyspri 0
#define maxclsyspri 0
#define minclsyspri PRIBIO
#define maxclsyspri PVM
#define max_ncpus mp_ncpus
#define boot_max_ncpus mp_ncpus
@ -58,6 +61,7 @@ static __inline kthread_t *
thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg,
size_t len, proc_t *pp, int state, pri_t pri)
{
kthread_t *td;
proc_t *p;
int error;
@ -70,7 +74,15 @@ thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg,
error = kproc_create(proc, arg, &p, 0, stksize / PAGE_SIZE,
"solthread %p", proc);
return (error == 0 ? FIRST_THREAD_IN_PROC(p) : NULL);
if (error != 0)
td = NULL;
else {
td = FIRST_THREAD_IN_PROC(p);
thread_lock(td);
sched_prio(td, pri);
thread_unlock(td);
}
return (td);
}
#define thread_exit() kproc_exit(0)