Module Name: src
Committed By: joerg
Date: Wed Mar 16 12:39:44 UTC 2011
Modified Files:
src/lib/libpthread: pthread_int.h
Log Message:
If TLS support is present, use it for pthread__self(). The
initialisation order is correct in this case as _lwp_setprivate has been
called already by ld.elf_so for dynamic programs or _libc_init for
statically linked ones.
To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/lib/libpthread/pthread_int.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libpthread/pthread_int.h
diff -u src/lib/libpthread/pthread_int.h:1.76 src/lib/libpthread/pthread_int.h:1.77
--- src/lib/libpthread/pthread_int.h:1.76 Wed Mar 9 23:10:06 2011
+++ src/lib/libpthread/pthread_int.h Wed Mar 16 12:39:44 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_int.h,v 1.76 2011/03/09 23:10:06 joerg Exp $ */
+/* $NetBSD: pthread_int.h,v 1.77 2011/03/16 12:39:44 joerg Exp $ */
/*-
* Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -255,21 +255,19 @@
} while (/*CONSTCOND*/0)
-#if 0 && defined(__HAVE___LWP_GETPRIVATE_FAST)
-# if defined(__HAVE_TLS_VARIANT_I) || defined(__HAVE_TLS_VARIANT_II)
+#if defined(__HAVE_TLS_VARIANT_I) || defined(__HAVE_TLS_VARIANT_II)
static inline pthread_t __constfunc
pthread__self(void)
{
- struct tls_tcb *tcb = __lwp_getprivate_fast()
+ struct tls_tcb *tcb = __lwp_getprivate_fast();
return (pthread_t)tcb->tcb_pthread;
}
-# else
+#elif 0 && defined(__HAVE___LWP_GETPRIVATE_FAST)
static inline pthread_t __constfunc
pthread__self(void)
{
return (pthread_t)__lwp_getprivate_fast();
}
-# endif
#else
/* Stack location of pointer to a particular thread */
extern vaddr_t pthread__mainbase;