+static void
+check_info (MonoThreadInfo *info, const gchar *action, const gchar *state)
+{
+ if (!info)
+ g_error ("Cannot %s GC %s region if the thread is not attached", action, state);
+ if (!mono_thread_info_is_current (info))
+ g_error ("[%p] Cannot %s GC %s region on a different thread", mono_thread_info_get_tid (info), action, state);
+ if (!mono_thread_info_is_live (info))
+ g_error ("[%p] Cannot %s GC %s region if the thread is not live", mono_thread_info_get_tid (info), action, state);
+}
+