diff options
author | jhb <jhb@FreeBSD.org> | 2003-08-04 20:28:20 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-08-04 20:28:20 +0000 |
commit | 52adb98aefd6ee43674dc6ccd40f9644daa3db66 (patch) | |
tree | d12abd056d97a52ac46bcb15559bb6e4e9b31282 /sys/kern | |
parent | a69166c61f00bbec68513d66d3613f2d50a5fe9a (diff) | |
download | FreeBSD-src-52adb98aefd6ee43674dc6ccd40f9644daa3db66.zip FreeBSD-src-52adb98aefd6ee43674dc6ccd40f9644daa3db66.tar.gz |
Set td_critnest to 1 when setting up a thread since it is a MI field with
MI values. This ensures that td_critnest for a newly fork'd thread is
always valid.
Requested by: bde (a long time ago)
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_kse.c | 1 | ||||
-rw-r--r-- | sys/kern/kern_thread.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c index 6bcbd95..421e437 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 6bcbd95..421e437 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; } /* |