diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2010-08-23 04:49:11 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2010-08-23 04:49:11 +0000 |
commit | 03aad00f384fe9547c3be370a3e09493e5f0d864 (patch) | |
tree | d7426c36f35e6f7bbf4ed95955e04967967f6671 /usr.sbin/faithd | |
parent | 13f9c0a053f90f932da4b904c48814c41b693bda (diff) |
fix two problems identified by matthew@:
1. though shalt not hold a mutex while sleeping, which kthread_create can
do. instead of holding the wq mutex over the kthread_create and increasing
the number of running threads after kthread_create succeeds, this counts
the thread and drops the mutex before kthread_create. after the call it
takes the mutex again and decrements the number of threads if the call
failed.
2. if a workq is created during autoconf, the actual thread create
is deferred to when the scheduler is running. if the workq is
destroyed before then, the wq memory gets freed and then the deferred
thread creation will be using freed memory. we now have a workq
state variable so we can do the right thing at the different stages
of the workqs lifetime.
ok matthew@
Diffstat (limited to 'usr.sbin/faithd')
0 files changed, 0 insertions, 0 deletions