本文整理汇总了C++中MonoThreadInfoCallbacks::mono_method_is_critical方法的典型用法代码示例。如果您正苦于以下问题:C++ MonoThreadInfoCallbacks::mono_method_is_critical方法的具体用法?C++ MonoThreadInfoCallbacks::mono_method_is_critical怎么用?C++ MonoThreadInfoCallbacks::mono_method_is_critical使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoThreadInfoCallbacks
的用法示例。
在下文中一共展示了MonoThreadInfoCallbacks::mono_method_is_critical方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/*
FIXME fix cardtable WB to be out of line and check with the runtime if the target is not the
WB trampoline. Another option is to encode wb ranges in MonoJitInfo, but that is somewhat hard.
*/
static gboolean
is_thread_in_critical_region (MonoThreadInfo *info)
{
MonoMethod *method;
MonoJitInfo *ji = mono_jit_info_table_find (
info->suspend_state.unwind_data [MONO_UNWIND_DATA_DOMAIN],
MONO_CONTEXT_GET_IP (&info->suspend_state.ctx));
if (!ji)
return FALSE;
method = ji->method;
return threads_callbacks.mono_method_is_critical (method);
}
示例2:
/*
FIXME fix cardtable WB to be out of line and check with the runtime if the target is not the
WB trampoline. Another option is to encode wb ranges in MonoJitInfo, but that is somewhat hard.
*/
static gboolean
is_thread_in_critical_region (MonoThreadInfo *info)
{
MonoMethod *method;
MonoJitInfo *ji;
gpointer stack_start;
MonoThreadUnwindState *state;
if (mono_threads_platform_in_critical_region (mono_thread_info_get_tid (info)))
return TRUE;
/* Are we inside a system critical region? */
if (info->inside_critical_region)
return TRUE;
/* Are we inside a GC critical region? */
if (threads_callbacks.mono_thread_in_critical_region && threads_callbacks.mono_thread_in_critical_region (info)) {
return TRUE;
}
/* The target thread might be shutting down and the domain might be null, which means no managed code left to run. */
state = mono_thread_info_get_suspend_state (info);
if (!state->unwind_data [MONO_UNWIND_DATA_DOMAIN])
return FALSE;
stack_start = MONO_CONTEXT_GET_SP (&state->ctx);
/* altstack signal handler, sgen can't handle them, so we treat them as critical */
if (stack_start < info->stack_start_limit || stack_start >= info->stack_end)
return TRUE;
if (threads_callbacks.ip_in_critical_region)
return threads_callbacks.ip_in_critical_region ((MonoDomain *) state->unwind_data [MONO_UNWIND_DATA_DOMAIN], (char *) MONO_CONTEXT_GET_IP (&state->ctx));
ji = mono_jit_info_table_find (
(MonoDomain *) state->unwind_data [MONO_UNWIND_DATA_DOMAIN],
(char *) MONO_CONTEXT_GET_IP (&state->ctx));
if (!ji)
return FALSE;
method = mono_jit_info_get_method (ji);
return threads_callbacks.mono_method_is_critical (method);
}
示例3:
/*
FIXME fix cardtable WB to be out of line and check with the runtime if the target is not the
WB trampoline. Another option is to encode wb ranges in MonoJitInfo, but that is somewhat hard.
*/
static gboolean
is_thread_in_critical_region (MonoThreadInfo *info)
{
MonoMethod *method;
MonoJitInfo *ji;
if (info->inside_critical_region)
return TRUE;
/* The target thread might be shutting down and the domain might be null, which means no managed code left to run. */
if (!info->suspend_state.unwind_data [MONO_UNWIND_DATA_DOMAIN])
return FALSE;
ji = mono_jit_info_table_find (
info->suspend_state.unwind_data [MONO_UNWIND_DATA_DOMAIN],
MONO_CONTEXT_GET_IP (&info->suspend_state.ctx));
if (!ji)
return FALSE;
method = mono_jit_info_get_method (ji);
return threads_callbacks.mono_method_is_critical (method);
}