summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2010-07-12 03:52:52 +0000
committerguenther <guenther@openbsd.org>2010-07-12 03:52:52 +0000
commit5ccf99cfcdefd8d6f537f2a29e31d3aab4ad454f (patch)
treee5da59fd9949a2e4969ecf5a02645f6f779cf14f /lib/libpthread
parentremove unused variable and unused static prototype. (diff)
downloadwireguard-openbsd-5ccf99cfcdefd8d6f537f2a29e31d3aab4ad454f.tar.xz
wireguard-openbsd-5ccf99cfcdefd8d6f537f2a29e31d3aab4ad454f.zip
After forking, clear the 'thread joining this one' pointer in the child,
as the child only has the one thread remaining. ok marc@
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 e80f2b3a140..16e32969e4f 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.21 2009/12/06 17:54:59 kurt Exp $ */
+/* $OpenBSD: uthread_fork.c,v 1.22 2010/07/12 03:52:52 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);
+ /* no one is joining the remaining thread */
+ curthread->joiner = NULL;
+
/* single threaded now */
__isthreaded = 0;