Enable test for #318677
[mono.git] / libgc / pthread_support.c
index f0132044a098c982ac032a2695d97f80c87238bc..2d54a513d017a742472cdb1c77a86f342047369d 100644 (file)
@@ -692,6 +692,9 @@ 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);
@@ -1341,7 +1344,8 @@ void * GC_start_routine_head(void * arg, void *base_addr,
     if (start) *start = si -> start_routine;
     if (start_arg) *start_arg = si -> arg;
 
-    sem_post(&(si -> registered));     /* Last action on si.   */
+       if (!(si->flags & FOREIGN_THREAD))
+               sem_post(&(si -> registered));  /* Last action on si.   */
                                        /* OK to deallocate.    */
 #   if defined(THREAD_LOCAL_ALLOC) && !defined(DBG_HDRS_ALL)
        LOCK();