Update.
authorUlrich Drepper <drepper@redhat.com>
Sun, 23 Feb 2003 09:16:11 +0000 (09:16 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 23 Feb 2003 09:16:11 +0000 (09:16 +0000)
2003-02-23  Ulrich Drepper  <drepper@redhat.com>

* resolv/res_libc.c [USE___THREAD] (_res): Initialize _vcsock
element to -1.

ChangeLog
nptl/ChangeLog
nptl/pthread_create.c
nptl/sysdeps/i386/tls.h
resolv/res_libc.c

index 359aa8d..e74f032 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-02-23  Ulrich Drepper  <drepper@redhat.com>
+
+       * resolv/res_libc.c [USE___THREAD] (_res): Initialize _vcsock
+       element to -1.
+
 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
 
        * sysdeps/generic/dl-sysdep.c: Avoid warning.
index 7515861..c44f1f5 100644 (file)
@@ -1,3 +1,10 @@
+2003-02-23  Ulrich Drepper  <drepper@redhat.com>
+
+       * pthread_create.c (start_thread): Set EXITING_BIT early.
+
+       * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
+       (THREAD_GETMEM_NC): Likewise.
+
 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
 
        * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
index 40a95c6..6ed5200 100644 (file)
@@ -228,6 +228,9 @@ start_thread (void *arg)
       pd->result = pd->start_routine (pd->arg);
     }
 
+  /* The thread is exiting now.  */
+  atomic_bit_set (&pd->cancelhandling, EXITING_BIT);
+
   /* Clean up any state libc stored in thread-local variables.  */
   __libc_thread_freeres ();
 
@@ -267,9 +270,6 @@ start_thread (void *arg)
     }
 
 
-  /* The thread is exiting now.  */
-  atomic_bit_set (&pd->cancelhandling, EXITING_BIT);
-
   /* If the thread is detached free the TCB.  */
   if (IS_DETACHED (pd))
     /* Free the TCB.  */
index c4bd1de..9c4c481 100644 (file)
@@ -247,13 +247,13 @@ union user_desc_init
 # define THREAD_GETMEM(descr, member) \
   ({ __typeof (descr->member) __value;                                       \
      if (sizeof (__value) == 1)                                                      \
-       asm ("movb %%gs:%P2,%b0"                                                      \
-           : "=q" (__value)                                                  \
-           : "0" (0), "i" (offsetof (struct pthread, member)));              \
+       asm volatile ("movb %%gs:%P2,%b0"                                     \
+                    : "=q" (__value)                                         \
+                    : "0" (0), "i" (offsetof (struct pthread, member)));     \
      else if (sizeof (__value) == 4)                                         \
-       asm ("movl %%gs:%P1,%0"                                               \
-           : "=r" (__value)                                                  \
-           : "i" (offsetof (struct pthread, member)));                       \
+       asm volatile ("movl %%gs:%P1,%0"                                              \
+                    : "=r" (__value)                                         \
+                    : "i" (offsetof (struct pthread, member)));              \
      else                                                                    \
        {                                                                     \
         if (sizeof (__value) != 8)                                           \
@@ -261,11 +261,11 @@ union user_desc_init
              4 or 8.  */                                                     \
           abort ();                                                          \
                                                                              \
-        asm ("movl %%gs:%P1,%%eax\n\t"                                       \
-             "movl %%gs:%P2,%%edx"                                           \
-             : "=A" (__value)                                                \
-             : "i" (offsetof (struct pthread, member)),                      \
-               "i" (offsetof (struct pthread, member) + 4));                 \
+        asm volatile ("movl %%gs:%P1,%%eax\n\t"                              \
+                      "movl %%gs:%P2,%%edx"                                  \
+                      : "=A" (__value)                                       \
+                      : "i" (offsetof (struct pthread, member)),             \
+                        "i" (offsetof (struct pthread, member) + 4));        \
        }                                                                     \
      __value; })
 
@@ -274,14 +274,15 @@ union user_desc_init
 # define THREAD_GETMEM_NC(descr, member, idx) \
   ({ __typeof (descr->member[0]) __value;                                    \
      if (sizeof (__value) == 1)                                                      \
-       asm ("movb %%gs:%P2(%3),%b0"                                          \
-           : "=q" (__value)                                                  \
-           : "0" (0), "i" (offsetof (struct pthread, member[0])),            \
-             "r" (idx));                                                     \
+       asm volatile ("movb %%gs:%P2(%3),%b0"                                 \
+                    : "=q" (__value)                                         \
+                    : "0" (0), "i" (offsetof (struct pthread, member[0])),   \
+                    "r" (idx));                                              \
      else if (sizeof (__value) == 4)                                         \
-       asm ("movl %%gs:%P1(,%2,4),%0"                                        \
-           : "=r" (__value)                                                  \
-           : "i" (offsetof (struct pthread, member[0])), "r" (idx));         \
+       asm volatile ("movl %%gs:%P1(,%2,4),%0"                               \
+                    : "=r" (__value)                                         \
+                    : "i" (offsetof (struct pthread, member[0])),            \
+                      "r" (idx));                                            \
      else                                                                    \
        {                                                                     \
         if (sizeof (__value) != 8)                                           \
@@ -289,10 +290,11 @@ union user_desc_init
              4 or 8.  */                                                     \
           abort ();                                                          \
                                                                              \
-        asm ("movl %%gs:%P1(,%2,8),%%eax\n\t"                                \
-             "movl %%gs:4+%P1(,%2,8),%%edx"                                  \
-             : "=&A" (__value)                                               \
-             : "i" (offsetof (struct pthread, member[0])), "r" (idx));       \
+        asm volatile  ("movl %%gs:%P1(,%2,8),%%eax\n\t"                      \
+                       "movl %%gs:4+%P1(,%2,8),%%edx"                        \
+                       : "=&A" (__value)                                     \
+                       : "i" (offsetof (struct pthread, member[0])),         \
+                         "r" (idx));                                         \
        }                                                                     \
      __value; })
 
index 763a887..a700e9d 100644 (file)
@@ -72,7 +72,7 @@ res_init(void) {
 
 #if USE___THREAD
 /* With __thread support, this per-thread variable is used in all cases.  */
-__thread struct __res_state _res;
+__thread struct __res_state _res = { ._vcsock = -1 };
 extern __thread struct __res_state __libc_res __attribute__ ((alias ("_res")))
   attribute_hidden;
 # define _res __libc_res