summaryrefslogtreecommitdiff
path: root/pthread_support.c
diff options
context:
space:
mode:
authorivmai <ivmai>2010-12-26 15:20:38 +0100
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:55 +0200
commit7b66e36f08dd096bc6df1ebc362d2689264f7825 (patch)
treece2884e5f794a843f6849592dd437c4e34eb427c /pthread_support.c
parentda518ec93509c607211f69d1ab0565fe0b663397 (diff)
2010-12-26 Ivan Maidanski <ivmai@mail.ru> (mostly really Geoff Norton
and Jonathan Pryor) * configure.ac: Use AC_CHECK_LIB() to check for pthread instead of just blindly linking to -lpthread, as Android includes pthread support within libc and does not provide a separate libpthread. * dyn_load.c (GC_register_dynamic_libraries): Skip current link map entry if l_addr is NULL (Android/bionic only). * pthread_stop_world.c (android_thread_kill): New internal function (Android only). * pthread_stop_world.c (GC_suspend_all, GC_start_world): Call android_thread_kill (based on tkill) instead of pthread_kill on Android (since pthread_kill cannot be used safely on the platform). * pthread_support.c (GC_new_thread): Store thread Id (obtained from gettid) for use by android_thread_kill (Android only). * include/private/pthread_support.h (GC_Thread_Rep): Add kernel_id structure member (Android only). * include/private/gcconfig.h: Recognize __x86_64 macro as a synonym of __x86_64__ (Darwin); define __environ macro (Android on M68K). * configure: Regenerate.
Diffstat (limited to 'pthread_support.c')
-rw-r--r--pthread_support.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pthread_support.c b/pthread_support.c
index 6041a66..26460a7 100644
--- a/pthread_support.c
+++ b/pthread_support.c
@@ -460,6 +460,9 @@ STATIC GC_thread GC_new_thread(pthread_t id)
if (result == 0) return(0);
}
result -> id = id;
+# ifdef PLATFORM_ANDROID
+ result -> kernel_id = gettid();
+# endif
result -> next = GC_threads[hv];
GC_threads[hv] = result;
GC_ASSERT(result -> flags == 0 && result -> thread_blocked == 0);