[threadpool-ms] Remove recursivity of active_threads_lock
[mono.git] / mono / metadata / sgen-os-mach.c
index eed558b976be6ec783cad9c4845819f45ee53b79..46d30d81c4d664f3386c040356e0e60f2023ae4d 100644 (file)
 
 
 #include <glib.h>
-#include "metadata/sgen-gc.h"
-#include "metadata/sgen-archdep.h"
-#include "metadata/sgen-protocol.h"
-#include "metadata/sgen-thread-pool.h"
+#include "sgen/sgen-gc.h"
+#include "sgen/sgen-archdep.h"
+#include "sgen/sgen-protocol.h"
+#include "sgen/sgen-thread-pool.h"
 #include "metadata/object-internals.h"
 #include "metadata/gc-internal.h"
 
@@ -40,6 +40,8 @@
 #endif
 
 #if defined(__MACH__) && MONO_MACH_ARCH_SUPPORTED
+
+#if !defined(USE_COOP_GC)
 gboolean
 sgen_resume_thread (SgenThreadInfo *info)
 {
@@ -73,26 +75,26 @@ sgen_suspend_thread (SgenThreadInfo *info)
 
        info->client_info.stopped_domain = mono_thread_info_tls_get (info, TLS_KEY_DOMAIN);
        info->client_info.stopped_ip = (gpointer) mono_mach_arch_get_ip (state);
-       info->stack_start = NULL;
+       info->client_info.stack_start = NULL;
        stack_start = (char*) mono_mach_arch_get_sp (state) - REDZONE_SIZE;
        /* If stack_start is not within the limits, then don't set it in info and we will be restarted. */
-       if (stack_start >= info->stack_start_limit && stack_start <= info->stack_end) {
-               info->stack_start = stack_start;
+       if (stack_start >= info->client_info.stack_start_limit && stack_start <= info->client_info.stack_end) {
+               info->client_info.stack_start = stack_start;
 
 #ifdef USE_MONO_CTX
-               mono_sigctx_to_monoctx (&ctx, &info->ctx);
+               mono_sigctx_to_monoctx (&ctx, &info->client_info.ctx);
 #else
-               ARCH_COPY_SIGCTX_REGS (&info->regs, &ctx);
+               ARCH_COPY_SIGCTX_REGS (&info->client_info.regs, &ctx);
 #endif
        } else {
-               g_assert (!info->stack_start);
+               g_assert (!info->client_info.stack_start);
        }
 
        /* Notify the JIT */
        if (mono_gc_get_gc_callbacks ()->thread_suspend_func)
-               mono_gc_get_gc_callbacks ()->thread_suspend_func (info->runtime_data, &ctx, NULL);
+               mono_gc_get_gc_callbacks ()->thread_suspend_func (info->client_info.runtime_data, &ctx, NULL);
 
-       SGEN_LOG (2, "thread %p stopped at %p stack_start=%p", (void*)(gsize)info->client_info.info.native_handle, info->client_info.stopped_ip, info->stack_start);
+       SGEN_LOG (2, "thread %p stopped at %p stack_start=%p", (void*)(gsize)info->client_info.info.native_handle, info->client_info.stopped_ip, info->client_info.stack_start);
        binary_protocol_thread_suspend ((gpointer)mono_thread_info_get_tid (info), info->client_info.stopped_ip);
 
        return TRUE;
@@ -120,7 +122,7 @@ sgen_thread_handshake (BOOL suspend)
                        continue;
 
                info->client_info.suspend_done = FALSE;
-               if (info->gc_disabled)
+               if (info->client_info.gc_disabled)
                        continue;
 
                if (suspend) {
@@ -154,3 +156,4 @@ mono_gc_get_restart_signal (void)
 }
 #endif
 #endif
+#endif