]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* config/vxlib.c (tls_delete_hook): Use TCB for kernel tasks.
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Mar 2007 14:13:30 +0000 (14:13 +0000)
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Mar 2007 14:13:30 +0000 (14:13 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123086 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/vxlib-tls.c

index 18a85ec79c824c078a7c36ee54b92f29de05450e..b395834b6bd14e373c06abc845419e0ccc23bd05 100644 (file)
@@ -1,3 +1,7 @@
+2007-03-20  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * config/vxlib.c (tls_delete_hook): Use TCB for kernel tasks.
+
 2007-03-19  Andrew Haley  <aph@redhat.com>
 
        PR tree-optimization/31264
index eba8f5cf54704607cb6151f7b6d1b917e9554b28..e98355591f8079bd4834f5672dd639a962fafb1b 100644 (file)
@@ -155,9 +155,18 @@ static __gthread_once_t tls_init_guard = __GTHREAD_ONCE_INIT;
 static void
 tls_delete_hook (void *tcb ATTRIBUTE_UNUSED)
 {
-  struct tls_data *data = __gthread_get_tls_data ();
+  struct tls_data *data;
   __gthread_key_t key;
 
+#ifdef __RTP__
+  data = __gthread_get_tls_data ();
+#else
+  /* In kernel mode, we can be called in the context of the thread
+     doing the killing, so must use the TCB to determine the data of
+     the thread being killed.  */
+  data = __gthread_get_tsd_data (tcb);
+#endif
+  
   if (data && data->owner == &self_owner)
     {
       __gthread_enter_tls_dtor_context ();
@@ -182,8 +191,11 @@ tls_delete_hook (void *tcb ATTRIBUTE_UNUSED)
            taskDeleteHookDelete ((FUNCPTR)tls_delete_hook);
          __gthread_mutex_unlock (&tls_lock);
        }
-
+#ifdef __RTP__
       __gthread_set_tls_data (0);
+#else
+      __gthread_set_tsd_data (tcb, 0);
+#endif
       __gthread_leave_tls_dtor_context ();
     }
 }