Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107069277
D44927.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
737 B
Referenced Files
None
Subscribers
None
D44927.diff
View Options
diff --git a/sys/kern/kern_kthread.c b/sys/kern/kern_kthread.c
--- a/sys/kern/kern_kthread.c
+++ b/sys/kern/kern_kthread.c
@@ -495,13 +495,21 @@
struct thread *td;
if (*procptr == NULL) {
+ /*
+ * Use RFSTOPPED to ensure that *tdptr is initialized before the
+ * thread starts running.
+ */
error = kproc_create(func, arg,
- procptr, flags, pages, "%s", procname);
+ procptr, flags | RFSTOPPED, pages, "%s", procname);
if (error)
return (error);
td = FIRST_THREAD_IN_PROC(*procptr);
if (tdptr)
*tdptr = td;
+ if ((flags & RFSTOPPED) == 0) {
+ thread_lock(td);
+ sched_add(td, SRQ_BORING);
+ }
va_start(ap, fmt);
vsnprintf(td->td_name, sizeof(td->td_name), fmt, ap);
va_end(ap);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 10, 3:20 PM (15 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15743705
Default Alt Text
D44927.diff (737 B)
Attached To
Mode
D44927: kthread: Set *tdptr earlier in kproc_kthread_add()
Attached
Detach File
Event Timeline
Log In to Comment