static void
check_info (MonoThreadInfo *info, const gchar *action, const gchar *state, const char *func)
{
- if (!info)
- g_error ("%s Cannot %s GC %s region if the thread is not attached", func, action, state);
- if (!mono_thread_info_is_current (info))
- g_error ("%s [%p] Cannot %s GC %s region on a different thread", func, mono_thread_info_get_tid (info), action, state);
- if (!mono_thread_info_is_live (info))
- g_error ("%s [%p] Cannot %s GC %s region if the thread is not live", func, mono_thread_info_get_tid (info), action, state);
+#ifdef ENABLE_CHECKED_BUILD
+ g_assertf (info, "%s Cannot %s GC %s region if the thread is not attached", func, action, state);
+ g_assertf (mono_thread_info_is_current (info), "%s [%p] Cannot %s GC %s region on a different thread", func, mono_thread_info_get_tid (info), action, state);
+ g_assertf (mono_thread_info_is_live (info), "%s [%p] Cannot %s GC %s region if the thread is not live", func, mono_thread_info_get_tid (info), action, state);
+#endif
}
static int coop_reset_blocking_count;
static void
check_thread_state (MonoThreadInfo* info)
{
+#ifdef ENABLE_CHECKED_BUILD
int raw_state, cur_state, suspend_count;
gboolean no_safepoints;
UNWRAP_THREAD_STATE (raw_state, cur_state, suspend_count, no_safepoints, info);
default:
g_error ("Invalid state %d", cur_state);
}
+#endif
}
static void