Merge pull request #1122 from PoppermostProductions/master
[mono.git] / mono / metadata / sgen-os-mach.c
index 14290d373d682bcbd84eb3e69ade4960a5ef27e6..fdbdb4b6f05d6ed52c8e0f132df538991fc6badb 100644 (file)
@@ -70,8 +70,7 @@ sgen_suspend_thread (SgenThreadInfo *info)
        mono_mach_arch_thread_state_to_mcontext (state, mctx);
        ctx.uc_mcontext = mctx;
 
-       info->stopped_domain = mono_mach_arch_get_tls_value_from_thread (
-               mono_thread_info_get_tid (info), mono_domain_get_tls_key ());
+       info->stopped_domain = mono_thread_info_tls_get (info, TLS_KEY_DOMAIN);
        info->stopped_ip = (gpointer) mono_mach_arch_get_ip (state);
        info->stack_start = NULL;
        stack_start = (char*) mono_mach_arch_get_sp (state) - REDZONE_SIZE;
@@ -92,7 +91,7 @@ sgen_suspend_thread (SgenThreadInfo *info)
        if (mono_gc_get_gc_callbacks ()->thread_suspend_func)
                mono_gc_get_gc_callbacks ()->thread_suspend_func (info->runtime_data, &ctx, NULL);
 
-       SGEN_LOG (2, "thread %p stopped at %p stack_start=%p", (void*)info->info.native_handle, info->stopped_ip, info->stack_start);
+       SGEN_LOG (2, "thread %p stopped at %p stack_start=%p", (void*)(gsize)info->info.native_handle, info->stopped_ip, info->stack_start);
 
        binary_protocol_thread_suspend ((gpointer)mono_thread_info_get_tid (info), info->stopped_ip);
 
@@ -116,25 +115,15 @@ sgen_thread_handshake (BOOL suspend)
        int count = 0;
 
        FOREACH_THREAD_SAFE (info) {
-               if (info->joined_stw == suspend)
-                       continue;
-               info->joined_stw = suspend;
-
                if (info == cur_thread || sgen_is_worker_thread (mono_thread_info_get_tid (info)))
                        continue;
                if (info->gc_disabled)
                        continue;
 
                if (suspend) {
-                       g_assert (!info->doing_handshake);
-                       info->doing_handshake = TRUE;
-
                        if (!sgen_suspend_thread (info))
                                continue;
                } else {
-                       g_assert (info->doing_handshake);
-                       info->doing_handshake = FALSE;
-
                        ret = thread_resume (info->info.native_handle);
                        if (ret != KERN_SUCCESS)
                                continue;
@@ -154,5 +143,11 @@ mono_gc_get_suspend_signal (void)
 {
        return -1;
 }
+
+int
+mono_gc_get_restart_signal (void)
+{
+       return -1;
+}
 #endif
 #endif