diff options
| author | ad <ad@NetBSD.org> | 2007-02-21 22:25:57 +0000 |
|---|---|---|
| committer | ad <ad@NetBSD.org> | 2007-02-21 22:25:57 +0000 |
| commit | dacd4bd9ca4e4cd8e55b86a5ab91b1e5fbf3b8ca (patch) | |
| tree | 573e22c081b3257fd52977e700c17c697c83a0d9 /lib/libpthread | |
| parent | 77468bf66822400aa326c397faccd992ef7883c8 (diff) | |
Minor optimisation to previous: only check for continued existence of
the thread if it was detached.
Diffstat (limited to 'lib/libpthread')
| -rw-r--r-- | lib/libpthread/pthread.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libpthread/pthread.c b/lib/libpthread/pthread.c index 4c25a2d63d6..b2b10a056ac 100644 --- a/lib/libpthread/pthread.c +++ b/lib/libpthread/pthread.c @@ -1,4 +1,4 @@ -/* $NetBSD: pthread.c,v 1.60 2007/02/15 15:39:38 yamt Exp $ */ +/* $NetBSD: pthread.c,v 1.61 2007/02/21 22:25:57 ad Exp $ */ /*- * Copyright (c) 2001, 2002, 2003, 2006 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: pthread.c,v 1.60 2007/02/15 15:39:38 yamt Exp $"); +__RCSID("$NetBSD: pthread.c,v 1.61 2007/02/21 22:25:57 ad Exp $"); #include <err.h> #include <errno.h> @@ -421,7 +421,8 @@ pthread_create(pthread_t *thread, const pthread_attr_t *attr, newthread = PTQ_FIRST(&pthread__deadqueue); if (newthread != NULL) { #ifndef PTHREAD_SA - if (_lwp_kill(newthread->pt_lid, 0) == 0 || errno != ESRCH) + if ((newthread->pt_flags & PT_FLAG_DETACHED) != 0 && + (_lwp_kill(newthread->pt_lid, 0) == 0 || errno != ESRCH)) newthread = NULL; else #endif |
