本文整理汇总了C++中MonoThreadInfoCallbacks::thread_attach方法的典型用法代码示例。如果您正苦于以下问题:C++ MonoThreadInfoCallbacks::thread_attach方法的具体用法?C++ MonoThreadInfoCallbacks::thread_attach怎么用?C++ MonoThreadInfoCallbacks::thread_attach使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoThreadInfoCallbacks
的用法示例。
在下文中一共展示了MonoThreadInfoCallbacks::thread_attach方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
MonoThreadInfo*
mono_thread_info_attach (void *baseptr)
{
MonoThreadInfo *info;
if (!mono_threads_inited)
{
#ifdef HOST_WIN32
/* This can happen from DllMain(DLL_THREAD_ATTACH) on Windows, if a
* thread is created before an embedding API user initialized Mono. */
THREADS_DEBUG ("mono_thread_info_attach called before mono_threads_init\n");
return NULL;
#else
g_assert (mono_threads_inited);
#endif
}
info = (MonoThreadInfo *) mono_native_tls_get_value (thread_info_key);
if (!info) {
info = (MonoThreadInfo *) g_malloc0 (thread_info_size);
THREADS_DEBUG ("attaching %p\n", info);
if (!register_thread (info, baseptr))
return NULL;
} else if (threads_callbacks.thread_attach) {
threads_callbacks.thread_attach (info);
}
return info;
}
示例2: if
MonoThreadInfo*
mono_thread_info_attach (void *baseptr)
{
MonoThreadInfo *info = mono_native_tls_get_value (thread_info_key);
if (!info) {
info = g_malloc0 (thread_info_size);
THREADS_DEBUG ("attaching %p\n", info);
if (!register_thread (info, baseptr))
return NULL;
} else if (threads_callbacks.thread_attach) {
threads_callbacks.thread_attach (info);
}
return info;
}