diff --git a/external/watch-mono b/external/watch-mono index e4d33f70d401..7ebae4c7f57a 160000 --- a/external/watch-mono +++ b/external/watch-mono @@ -1 +1 @@ -Subproject commit e4d33f70d401e579cf5345a6eb777c673d3a5964 +Subproject commit 7ebae4c7f57a6c1b4d0a38e69f270a016b6f3143 diff --git a/runtime/exports.t4 b/runtime/exports.t4 index e12768ac512e..11db2682934f 100644 --- a/runtime/exports.t4 +++ b/runtime/exports.t4 @@ -516,13 +516,7 @@ #region mini/mini.h new Export ("void*", "mono_jit_thread_attach", - "MonoDomain *", "domain", - "void *", "dummy" - ), - - new Export ("void", "mono_jit_thread_detach", - "void *", "cookie", - "void *", "dummy" + "MonoDomain *", "domain" ), new Export ("gboolean", "mono_exception_walk_trace", @@ -601,6 +595,20 @@ #region utils/mono-threads.h new Export ("void*", "mono_thread_info_current_unchecked" ), #endregion + + #region metadata/threads-types.h + + new Export (true, "void *", "mono_threads_attach_coop", + "MonoDomain *", "domain", + "gpointer*", "dummy" + ), + + new Export (true, "void *", "mono_threads_detach_coop", + "gpointer", "cookie", + "gpointer*", "dummy" + ), + + #endregion }; #><#+ class Arg diff --git a/runtime/xamarin/runtime.h b/runtime/xamarin/runtime.h index e19ae3106171..8ae912a55de5 100644 --- a/runtime/xamarin/runtime.h +++ b/runtime/xamarin/runtime.h @@ -258,15 +258,26 @@ class XamarinObject { #endif /* !TARGET_OS_WATCH */ +// Once we have one mono clone again the TARGET_OS_WATCH +// should be removed (DYNAMIC_MONO_RUNTIME should still +// be here though). +#if TARGET_OS_WATCH || DYNAMIC_MONO_RUNTIME #define MONO_THREAD_ATTACH \ do { \ gpointer __thread_dummy; \ - gpointer __thread_cookie = mono_jit_thread_attach (NULL, &__thread_dummy) \ + gpointer __thread_cookie = mono_threads_attach_coop (NULL, &__thread_dummy) \ #define MONO_THREAD_DETACH \ - mono_jit_thread_detach (__thread_cookie, &__thread_dummy); \ + mono_threads_detach_coop (__thread_cookie, &__thread_dummy); \ } while (0) +#else +#define MONO_THREAD_ATTACH \ + do { \ + mono_jit_thread_attach (NULL) \ +#define MONO_THREAD_DETACH \ + } while (0) +#endif #ifdef __cplusplus } /* extern "C" */