#if defined(HAVE_SGEN_GC) && defined(HOST_WIN32)
-#include <windows.h>
+#include "io-layer/io-layer.h"
#include "metadata/sgen-gc.h"
#include "metadata/gc-internal.h"
gboolean
-mono_sgen_resume_thread (SgenThreadInfo *info)
+sgen_resume_thread (SgenThreadInfo *info)
{
DWORD id = mono_thread_info_get_tid (info);
HANDLE handle = OpenThread (THREAD_ALL_ACCESS, FALSE, id);
}
gboolean
-mono_sgen_suspend_thread (SgenThreadInfo *info)
+sgen_suspend_thread (SgenThreadInfo *info)
{
DWORD id = mono_thread_info_get_tid (info);
HANDLE handle = OpenThread (THREAD_ALL_ACCESS, FALSE, id);
info->regs [5] = context.Eax;
info->regs [6] = context.Ebp;
info->regs [7] = context.Esp;
- info->stopped_regs = &info->regs;
/* Notify the JIT */
if (mono_gc_get_gc_callbacks ()->thread_suspend_func)
- mono_gc_get_gc_callbacks ()->thread_suspend_func (info->runtime_data, NULL);
+ mono_gc_get_gc_callbacks ()->thread_suspend_func (info->runtime_data, NULL, NULL);
return TRUE;
}
void
-mono_sgen_wait_for_suspend_ack (int count)
+sgen_wait_for_suspend_ack (int count)
{
/* Win32 suspend/resume is synchronous, so we don't need to wait for anything */
}
int
-mono_sgen_thread_handshake (BOOL suspend)
+sgen_thread_handshake (BOOL suspend)
{
SgenThreadInfo *info;
SgenThreadInfo *current = mono_thread_info_current ();
int count = 0;
FOREACH_THREAD_SAFE (info) {
+ if (info->joined_stw == suspend)
+ continue;
+ info->joined_stw = suspend;
if (info == current)
continue;
if (info->gc_disabled)
g_assert (!info->doing_handshake);
info->doing_handshake = TRUE;
- if (!mono_sgen_suspend_thread (info))
+ if (!sgen_suspend_thread (info))
continue;
} else {
g_assert (info->doing_handshake);
info->doing_handshake = FALSE;
- if (!mono_sgen_resume_thread (info))
+ if (!sgen_resume_thread (info))
continue;
}
-
++count;
} END_FOREACH_THREAD_SAFE
return count;
}
void
-mono_sgen_os_init (void)
+sgen_os_init (void)
{
}