Do no declare kernel_id field of GC_Thread_Rep for 64-bit Android
authorIvan Maidanski <ivmai@mail.ru>
Thu, 29 Oct 2015 21:08:44 +0000 (00:08 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 29 Oct 2015 21:08:44 +0000 (00:08 +0300)
* include/private/pthread_support.h (GC_Thread_Rep): Do not declare
kernel_id field unless USE_TKILL_ON_ANDROID (instead of
PLATFORM_ANDROID).
* pthread_support.c (GC_new_thread, GC_remove_all_threads_but_me): Do
not set kernel_id field unless USE_TKILL_ON_ANDROID.

include/private/pthread_support.h
pthread_support.c

index 7b4814c..294aeed 100644 (file)
@@ -46,7 +46,7 @@ typedef struct GC_Thread_Rep {
                                   /* guaranteed to be dead, but we may  */
                                   /* not yet have registered the join.) */
     pthread_t id;
-#   ifdef PLATFORM_ANDROID
+#   ifdef USE_TKILL_ON_ANDROID
       pid_t kernel_id;
 #   endif
     /* Extra bookkeeping information the stopping code uses */
index 7c5af41..d9f935f 100644 (file)
@@ -513,7 +513,7 @@ STATIC GC_thread GC_new_thread(pthread_t id)
         if (result == 0) return(0);
     }
     result -> id = id;
-#   ifdef PLATFORM_ANDROID
+#   ifdef USE_TKILL_ON_ANDROID
       result -> kernel_id = gettid();
 #   endif
     result -> next = GC_threads[hv];
@@ -717,7 +717,8 @@ STATIC void GC_remove_all_threads_but_me(void)
             /* GC_destroy_thread_local and GC_free_internal     */
             /* before update).                                  */
             me -> stop_info.mach_thread = mach_thread_self();
-#         elif defined(PLATFORM_ANDROID)
+#         endif
+#         ifdef USE_TKILL_ON_ANDROID
             me -> kernel_id = gettid();
 #         endif
 #         if defined(THREAD_LOCAL_ALLOC) && !defined(USE_CUSTOM_SPECIFIC)