summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2009-10-21 15:32:01 +0000
committerguenther <guenther@openbsd.org>2009-10-21 15:32:01 +0000
commitd049d58ece11c9b3daf3643e3562f4af85260160 (patch)
treeac36efda4f74fdb5c585cd176d1c2b3eda9f0563 /lib/libpthread
parentsort options; synchronize argument names with synopsis; (diff)
downloadwireguard-openbsd-d049d58ece11c9b3daf3643e3562f4af85260160.tar.xz
wireguard-openbsd-d049d58ece11c9b3daf3643e3562f4af85260160.zip
After forking, the child is single threaded, so tell libc that. This
is needed to avoid deadlocks in popen() on FILE locking. ok kurt@
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/uthread/uthread_fork.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libpthread/uthread/uthread_fork.c b/lib/libpthread/uthread/uthread_fork.c
index 4eceda4c86c..726b578e3af 100644
--- a/lib/libpthread/uthread/uthread_fork.c
+++ b/lib/libpthread/uthread/uthread_fork.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_fork.c,v 1.19 2008/04/04 19:30:41 kurt Exp $ */
+/* $OpenBSD: uthread_fork.c,v 1.20 2009/10/21 15:32:01 guenther Exp $ */
/*
* Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
* All rights reserved.
@@ -184,6 +184,9 @@ _dofork(int vfork)
/* Re-init the threads mutex queue: */
TAILQ_INIT(&curthread->mutexq);
+ /* single threaded now */
+ __isthreaded = 0;
+
/* No spinlocks yet: */
_spinblock_count = 0;