mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-10 14:02:43 +00:00
Defer thread start until we set priority.
Reviewed by: kib MFC after: 3 days
This commit is contained in:
parent
c739b7b22b
commit
08780916dd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=196947
@ -37,6 +37,7 @@
|
||||
#include <sys/sched.h>
|
||||
#include <sys/lock.h>
|
||||
#include <sys/mutex.h>
|
||||
#include <sys/unistd.h>
|
||||
#include <sys/debug.h>
|
||||
|
||||
#ifdef _KERNEL
|
||||
@ -74,11 +75,12 @@ thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg,
|
||||
ASSERT(state == TS_RUN);
|
||||
ASSERT(pp == &p0);
|
||||
|
||||
error = kproc_kthread_add(proc, arg, &zfsproc, &td, 0,
|
||||
error = kproc_kthread_add(proc, arg, &zfsproc, &td, RFSTOPPED,
|
||||
stksize / PAGE_SIZE, "zfskern", "solthread %p", proc);
|
||||
if (error == 0) {
|
||||
thread_lock(td);
|
||||
sched_prio(td, pri);
|
||||
sched_add(td, SRQ_BORING);
|
||||
thread_unlock(td);
|
||||
}
|
||||
return (td);
|
||||
|
Loading…
Reference in New Issue
Block a user