diff options
author | mux <mux@FreeBSD.org> | 2002-11-22 23:57:02 +0000 |
---|---|---|
committer | mux <mux@FreeBSD.org> | 2002-11-22 23:57:02 +0000 |
commit | 8169a213d9a6bf39cd5d8997fca80feb42593c18 (patch) | |
tree | 7cbae531ab4775242ecb958ecd8e856d8a54d011 /sys/kern/kern_thread.c | |
parent | da5ffde8ea63a508153b9f3385bf13689e9dfddc (diff) | |
download | FreeBSD-src-8169a213d9a6bf39cd5d8997fca80feb42593c18.zip FreeBSD-src-8169a213d9a6bf39cd5d8997fca80feb42593c18.tar.gz |
Under certain circumstances, we were calling kmem_free() from
i386 cpu_thread_exit(). This resulted in a panic with WITNESS
since we need to hold Giant to call kmem_free(), and we weren't
helding it anymore in cpu_thread_exit(). We now do this from a
new MD function, cpu_thread_dtor(), called by thread_dtor().
Approved by: re@
Suggested by: jhb
Diffstat (limited to 'sys/kern/kern_thread.c')
-rw-r--r-- | sys/kern/kern_thread.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 45ac5c0..cf17c08 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -115,6 +115,7 @@ thread_dtor(void *mem, int size, void *arg) { struct thread *td; + mtx_assert(&Giant, MA_OWNED); td = (struct thread *)mem; #ifdef INVARIANTS @@ -137,6 +138,8 @@ thread_dtor(void *mem, int size, void *arg) /* NOTREACHED */ } #endif + + cpu_thread_dtor(td); } /* |