#include <mono/utils/mach-support.h>
#include <mono/utils/mono-compiler.h>
-#include <mono/utils/mono-semaphore.h>
#include <mono/utils/mono-threads.h>
#include <mono/utils/hazard-pointer.h>
mono_threads_init_dead_letter ();
}
+#if defined(HOST_WATCHOS) || defined(HOST_TVOS)
+
+gboolean
+mono_threads_core_begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_kernel)
+{
+ g_assert_not_reached ();
+}
+
+gboolean
+mono_threads_core_check_suspend_result (MonoThreadInfo *info)
+{
+ g_assert_not_reached ();
+}
+
+gboolean
+mono_threads_core_begin_async_resume (MonoThreadInfo *info)
+{
+ g_assert_not_reached ();
+}
+
+#else /* defined(HOST_WATCHOS) || defined(HOST_TVOS) */
+
gboolean
mono_threads_core_begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_kernel)
{
return FALSE;
mono_mach_arch_thread_state_to_mcontext (state, mctx);
-#ifdef TARGET_ARM64
- g_assert_not_reached ();
-#else
uctx.uc_mcontext = mctx;
-#endif
mono_monoctx_to_sigctx (&tmp, &uctx);
mono_mach_arch_mcontext_to_thread_state (mctx, state);
return ret == KERN_SUCCESS;
}
+#endif /* defined(HOST_WATCHOS) || defined(HOST_TVOS) */
+
void
mono_threads_platform_register (MonoThreadInfo *info)
{
+ char thread_name [64];
+
info->native_handle = mach_thread_self ();
+
+ snprintf (thread_name, sizeof (thread_name), "tid_%x", (int) info->native_handle);
+ pthread_setname_np (thread_name);
+
mono_threads_install_dead_letter ();
}
mach_port_deallocate (current_task (), info->native_handle);
}
-void
-mono_threads_core_begin_global_suspend (void)
-{
-}
-
-void
-mono_threads_core_end_global_suspend (void)
-{
-}
-
#endif /* USE_MACH_BACKEND */
#ifdef __MACH__