Commit 91fbdc0e authored by Jean-Claude Beaudoin's avatar Jean-Claude Beaudoin
Browse files

Get rid of tkill() call on Android.

parent f80f224a
...@@ -46,7 +46,7 @@ typedef struct MK_GC_Thread_Rep { ...@@ -46,7 +46,7 @@ typedef struct MK_GC_Thread_Rep {
/* guaranteed to be dead, but we may */ /* guaranteed to be dead, but we may */
/* not yet have registered the join.) */ /* not yet have registered the join.) */
pthread_t id; pthread_t id;
# ifdef PLATFORM_ANDROID # if 0 /* JCB */ && defined(PLATFORM_ANDROID)
pid_t kernel_id; pid_t kernel_id;
# endif # endif
/* Extra bookkeeping information the stopping code uses */ /* Extra bookkeeping information the stopping code uses */
......
...@@ -439,8 +439,9 @@ MK_GC_INNER void MK_GC_push_all_stacks(void) ...@@ -439,8 +439,9 @@ MK_GC_INNER void MK_GC_push_all_stacks(void)
int MK_GC_stopping_pid = 0; int MK_GC_stopping_pid = 0;
#endif #endif
#ifdef PLATFORM_ANDROID #if 0 /* JCB */ && defined(PLATFORM_ANDROID)
extern int tkill(pid_t tid, int sig); /* from sys/linux-unistd.h */ /* I have no idea why this code was needed on Android at any time! Must be ancient... JCB 2020/05/12 */
extern int tkill(pid_t tid, int sig); /* from sys/linux-unistd.h */ /* No such file anymore! JCB */
static int android_thread_kill(pid_t tid, int sig) static int android_thread_kill(pid_t tid, int sig)
{ {
...@@ -499,7 +500,7 @@ STATIC int MK_GC_suspend_all(void) ...@@ -499,7 +500,7 @@ STATIC int MK_GC_suspend_all(void)
p -> stop_info.stack_ptr = (ptr_t)stack.ss_sp - stack.ss_size; p -> stop_info.stack_ptr = (ptr_t)stack.ss_sp - stack.ss_size;
} }
# else # else
# ifndef PLATFORM_ANDROID # if 1 /* JCB */ || !defined(PLATFORM_ANDROID)
result = pthread_kill(p -> id, MK_GC_sig_suspend); result = pthread_kill(p -> id, MK_GC_sig_suspend);
# else # else
result = android_thread_kill(p -> kernel_id, MK_GC_sig_suspend); result = android_thread_kill(p -> kernel_id, MK_GC_sig_suspend);
...@@ -835,7 +836,7 @@ MK_GC_INNER void MK_GC_start_world(void) ...@@ -835,7 +836,7 @@ MK_GC_INNER void MK_GC_start_world(void)
if (pthread_resume_np(p -> id) != 0) if (pthread_resume_np(p -> id) != 0)
ABORT("pthread_resume_np failed"); ABORT("pthread_resume_np failed");
# else # else
# ifndef PLATFORM_ANDROID # if 1 /* JCB */ || !defined(PLATFORM_ANDROID)
result = pthread_kill(p -> id, MK_GC_sig_thr_restart); result = pthread_kill(p -> id, MK_GC_sig_thr_restart);
# else # else
result = android_thread_kill(p -> kernel_id, result = android_thread_kill(p -> kernel_id,
......
...@@ -505,7 +505,7 @@ STATIC MK_GC_thread MK_GC_new_thread(pthread_t id) ...@@ -505,7 +505,7 @@ STATIC MK_GC_thread MK_GC_new_thread(pthread_t id)
if (result == 0) return(0); if (result == 0) return(0);
} }
result -> id = id; result -> id = id;
# ifdef PLATFORM_ANDROID # if 0 /* JCB */ && defined(PLATFORM_ANDROID)
result -> kernel_id = gettid(); result -> kernel_id = gettid();
# endif # endif
result -> next = MK_GC_threads[hv]; result -> next = MK_GC_threads[hv];
...@@ -679,7 +679,7 @@ STATIC void MK_GC_remove_all_threads_but_me(void) ...@@ -679,7 +679,7 @@ STATIC void MK_GC_remove_all_threads_but_me(void)
/* MK_GC_destroy_thread_local and MK_GC_free_internal */ /* MK_GC_destroy_thread_local and MK_GC_free_internal */
/* before update). */ /* before update). */
me -> stop_info.mach_thread = mach_thread_self(); me -> stop_info.mach_thread = mach_thread_self();
# elif defined(PLATFORM_ANDROID) # elif 0 /* JCB */ && defined(PLATFORM_ANDROID)
me -> kernel_id = gettid(); me -> kernel_id = gettid();
# endif # endif
# if defined(THREAD_LOCAL_ALLOC) && !defined(USE_CUSTOM_SPECIFIC) # if defined(THREAD_LOCAL_ALLOC) && !defined(USE_CUSTOM_SPECIFIC)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment