summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2010-07-13 04:24:46 +0000
committerguenther <guenther@openbsd.org>2010-07-13 04:24:46 +0000
commit0b97e862f4a1c431e0fc15b9afafa693914dbbb0 (patch)
tree063d90c50543c9e9286eea5988dee098eaac18d6 /lib/libpthread
parentFix PR 6376: restore more thread library state if execve fails, (diff)
downloadwireguard-openbsd-0b97e862f4a1c431e0fc15b9afafa693914dbbb0.tar.xz
wireguard-openbsd-0b97e862f4a1c431e0fc15b9afafa693914dbbb0.zip
Fix PR 6417: if we're starting a thread and there's no other threads
running, then we need to start a gc thread...except when this is the very call to start a gc thread! "This works for me" marc@
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/uthread/uthread_create.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libpthread/uthread/uthread_create.c b/lib/libpthread/uthread/uthread_create.c
index fe40c5e3133..e2248a9aef8 100644
--- a/lib/libpthread/uthread/uthread_create.c
+++ b/lib/libpthread/uthread/uthread_create.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_create.c,v 1.24 2009/07/25 02:09:20 kurt Exp $ */
+/* $OpenBSD: uthread_create.c,v 1.25 2010/07/13 04:24:46 guenther Exp $ */
/*
* Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
* All rights reserved.
@@ -179,7 +179,8 @@ pthread_create(pthread_t *thread, const pthread_attr_t *attr,
* Check if the garbage collector thread
* needs to be started.
*/
- f_gc = (TAILQ_FIRST(&_thread_list) == _thread_initial);
+ f_gc = (TAILQ_FIRST(&_thread_list) == _thread_initial
+ && start_routine != _thread_gc);
/* Add the thread to the linked list of all threads: */
TAILQ_INSERT_HEAD(&_thread_list, new_thread, tle);