summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/getenv.c
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2010-08-23 04:49:10 +0000
committerdlg <dlg@openbsd.org>2010-08-23 04:49:10 +0000
commit9777239ca680c743cd66ae408bcaa3130e50a0b4 (patch)
treeb0dc750d90158ec21ed8f08d09e3af6f662e2fd4 /lib/libc/stdlib/getenv.c
parentunbreak tree: add VIS_HEX and VIS_ALL flags (diff)
downloadwireguard-openbsd-9777239ca680c743cd66ae408bcaa3130e50a0b4.tar.xz
wireguard-openbsd-9777239ca680c743cd66ae408bcaa3130e50a0b4.zip
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 'lib/libc/stdlib/getenv.c')
0 files changed, 0 insertions, 0 deletions