summaryrefslogtreecommitdiff
path: root/lib/libpthread
diff options
context:
space:
mode:
authorjoerg <joerg@NetBSD.org>2012-05-04 12:26:33 +0000
committerjoerg <joerg@NetBSD.org>2012-05-04 12:26:33 +0000
commit0cbed0f4f2f5eecb2e3e23668e0a82696a209ebc (patch)
tree78dc29bd7875ee8cf51df84889eac4eca5f20c84 /lib/libpthread
parented5c821ae2323b747b93767daedf8b57d48b436d (diff)
Simplify check for TLS definition to not hide code. Drop it in another
place as it is redundant.
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/pthread.c12
-rw-r--r--lib/libpthread/pthread_int.h10
2 files changed, 10 insertions, 12 deletions
diff --git a/lib/libpthread/pthread.c b/lib/libpthread/pthread.c
index 4e9ef1858ed..aa603b32f11 100644
--- a/lib/libpthread/pthread.c
+++ b/lib/libpthread/pthread.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread.c,v 1.134 2012/04/26 00:21:44 enami Exp $ */
+/* $NetBSD: pthread.c,v 1.135 2012/05/04 12:26:33 joerg Exp $ */
/*-
* Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread.c,v 1.134 2012/04/26 00:21:44 enami Exp $");
+__RCSID("$NetBSD: pthread.c,v 1.135 2012/05/04 12:26:33 joerg Exp $");
#define __EXPOSE_STACK 1
@@ -1301,14 +1301,12 @@ pthread__initmain(pthread_t *newt)
4 * pthread__pagesize / 1024);
*newt = &pthread__main;
-#if defined(__HAVE_TLS_VARIANT_I) || defined(__HAVE_TLS_VARIANT_II)
-# ifdef __HAVE___LWP_GETTCB_FAST
+#ifdef __HAVE___LWP_GETTCB_FAST
pthread__main.pt_tls = __lwp_gettcb_fast();
-# else
+#else
pthread__main.pt_tls = _lwp_getprivate();
-# endif
- pthread__main.pt_tls->tcb_pthread = &pthread__main;
#endif
+ pthread__main.pt_tls->tcb_pthread = &pthread__main;
}
#ifndef lint
diff --git a/lib/libpthread/pthread_int.h b/lib/libpthread/pthread_int.h
index d1c5a903204..1158b90dc42 100644
--- a/lib/libpthread/pthread_int.h
+++ b/lib/libpthread/pthread_int.h
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_int.h,v 1.84 2012/03/12 20:16:52 joerg Exp $ */
+/* $NetBSD: pthread_int.h,v 1.85 2012/05/04 12:26:33 joerg Exp $ */
/*-
* Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -256,7 +256,10 @@ int pthread__find(pthread_t) PTHREAD_HIDE;
} while (/*CONSTCOND*/0)
-#if defined(__HAVE_TLS_VARIANT_I) || defined(__HAVE_TLS_VARIANT_II)
+#if !defined(__HAVE_TLS_VARIANT_I) && !defined(__HAVE_TLS_VARIANT_II)
+#error Either __HAVE_TLS_VARIANT_I or __HAVE_TLS_VARIANT_II must be defined
+#endif
+
static inline pthread_t __constfunc
pthread__self(void)
{
@@ -267,9 +270,6 @@ pthread__self(void)
#endif
return (pthread_t)tcb->tcb_pthread;
}
-#else
-#error Either __HAVE_TLS_VARIANT_I or __HAVE_TLS_VARIANT_II must be defined
-#endif
#define pthread__abort() \
pthread__assertfunc(__FILE__, __LINE__, __func__, "unreachable")