From 0b97e862f4a1c431e0fc15b9afafa693914dbbb0 Mon Sep 17 00:00:00 2001 From: guenther Date: Tue, 13 Jul 2010 04:24:46 +0000 Subject: [PATCH] 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@ --- lib/libpthread/uthread/uthread_create.c | 5 +++-- 1 file 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 * 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); -- 2.20.1