]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Actually call VGA_(has_tls) rather than just testing the function
authorTom Hughes <tom@compton.nu>
Mon, 25 Oct 2004 16:59:46 +0000 (16:59 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 25 Oct 2004 16:59:46 +0000 (16:59 +0000)
address - this replaces Nick's replacing of the has_tls call with
an inline version.

BUG: 91844

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2832

coregrind/x86/libpthread.c

index 240aa0f02ac8b875b3d36d6083a79d10747888d0..40db0bca0cb1b00451975b4efc1c471f69800f17 100644 (file)
@@ -96,18 +96,7 @@ Bool VGA_(has_tls)(void)
 
 void VGA_(thread_create)(arch_thread_aux_t *aux)
 {
-   // Weirdness alert:  I tried removing this call to get_gs() by using a
-   // call to VGA_(has_tls)() in the condition, and Jeroen Witmond
-   // experienced mysterious regtest failures (some of the pth_* ones) on
-   // on of his machines:
-   //
-   //   'Linux DoornRoosje 2.4.26-1-386 #1 Tue Aug // 24
-   //    13:31:19 JST 2004 i686 GNU/Linux' (Debian sarge)
-   //
-   // I don't understand what the difference is either.  Compiler bug?  --njn
-   int gs = get_gs();
-   
-   if ((gs & 7) == 3) {
+   if (VGA_(has_tls)()) {
       tcbhead_t *tcb = get_tcb();
 
       if (allocate_tls == NULL || deallocate_tls == NULL) {
@@ -118,7 +107,7 @@ void VGA_(thread_create)(arch_thread_aux_t *aux)
       my_assert(allocate_tls != NULL);
       
       aux->tls_data = allocate_tls(NULL);
-      aux->tls_segment = gs >> 3;
+      aux->tls_segment = get_gs() >> 3;
       aux->sysinfo = tcb->sysinfo;
 
       tcb->multiple_threads = 1;