diff options
author | phk <phk@FreeBSD.org> | 2005-03-19 08:22:13 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2005-03-19 08:22:13 +0000 |
commit | 22cd1201ca327f9990311c8f2e47e2b942fbe4d4 (patch) | |
tree | 0d5e9d785a00cafeeabb7899dfab4f03b7dab31e | |
parent | 2cb43d3de1d4cb80657f2f52553874b41640516d (diff) | |
download | FreeBSD-src-22cd1201ca327f9990311c8f2e47e2b942fbe4d4.zip FreeBSD-src-22cd1201ca327f9990311c8f2e47e2b942fbe4d4.tar.gz |
Sleeping is not allowed in uma->fini
-rw-r--r-- | sys/kern/kern_thread.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index f296bea..1b26e8f 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -118,6 +118,8 @@ thread_ctor(void *mem, int size, void *arg, int flags) td->td_state = TDS_INACTIVE; td->td_oncpu = NOCPU; + td->td_tid = alloc_unr(tid_unrhdr); + /* * Note that td_critnest begins life as 1 because the thread is not * running and is thereby implicitly waiting to be on the receiving @@ -164,6 +166,8 @@ thread_dtor(void *mem, int size, void *arg) /* NOTREACHED */ } #endif + + free_unr(tid_unrhdr, td->td_tid); sched_newthread(td); } @@ -177,8 +181,6 @@ thread_init(void *mem, int size, int flags) td = (struct thread *)mem; - td->td_tid = alloc_unr(tid_unrhdr); - vm_thread_new(td, 0); cpu_thread_setup(td); td->td_sleepqueue = sleepq_alloc(); @@ -202,8 +204,6 @@ thread_fini(void *mem, int size) sleepq_free(td->td_sleepqueue); umtxq_free(td->td_umtxq); vm_thread_dispose(td); - - free_unr(tid_unrhdr, td->td_tid); } /* |