diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c index 6bcbd9538f31..421e4373b13c 100644 --- a/sys/kern/kern_kse.c +++ b/sys/kern/kern_kse.c @@ -142,6 +142,7 @@ thread_ctor(void *mem, int size, void *arg) td = (struct thread *)mem; td->td_state = TDS_INACTIVE; td->td_oncpu = NOCPU; + td->td_critnest = 1; } /* diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 6bcbd9538f31..421e4373b13c 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -142,6 +142,7 @@ thread_ctor(void *mem, int size, void *arg) td = (struct thread *)mem; td->td_state = TDS_INACTIVE; td->td_oncpu = NOCPU; + td->td_critnest = 1; } /* diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 47188fb898d9..97d0699dcc93 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -294,7 +294,6 @@ struct thread { u_int td_uuticks; /* (*) Statclock in user, for UTS */ u_int td_usticks; /* (*) Statclock in kernel, for UTS */ int td_intrval; /* (*) Return value of TDF_INTERRUPT */ - u_int td_critnest; /* (k) Critical section nest level. */ sigset_t td_oldsigmask; /* (k) Saved mask from pre sigpause. */ sigset_t td_sigmask; /* (c) Current signal mask. */ sigset_t td_siglist; /* (c) Sigs arrived, not delivered. */ @@ -330,6 +329,7 @@ struct thread { struct vm_object *td_altkstack_obj;/* (a) Alternate kstack object. */ vm_offset_t td_altkstack; /* (a) Kernel VA of alternate kstack. */ int td_altkstack_pages; /* (a) Size of the alternate kstack */ + u_int td_critnest; /* (k) Critical section nest level. */ struct mdthread td_md; /* (k) Any machine-dependent fields. */ struct td_sched *td_sched; /* (*) Scheduler specific data */ };