提交 26f2e1b0 编写于 作者: G Gabriele Farina

Expose separate function to determine if thread is attached. Revert unity...

Expose separate function to determine if thread is attached. Revert unity specific change to prevent mono_thread_current from auto attaching.
上级 544d092f
...@@ -1299,14 +1299,28 @@ mono_thread_current (void) ...@@ -1299,14 +1299,28 @@ mono_thread_current (void)
current_thread_ptr = get_current_thread_ptr_for_domain (domain, internal); current_thread_ptr = get_current_thread_ptr_for_domain (domain, internal);
// UNITY: we don't want to attach just because we call mono_thread_current if (!*current_thread_ptr) {
// if (!*current_thread_ptr) { g_assert (domain != mono_get_root_domain ());
// g_assert (domain != mono_get_root_domain ()); *current_thread_ptr = new_thread_with_internal (domain, internal);
// *current_thread_ptr = new_thread_with_internal (domain, internal); }
// }
return *current_thread_ptr; return *current_thread_ptr;
} }
MonoBoolean
mono_unity_thread_is_attached ()
{
MonoDomain *domain = mono_domain_get ();
MonoInternalThread *internal = mono_thread_internal_current ();
MonoThread **current_thread_ptr;
if (!domain || !internal)
return FALSE;
current_thread_ptr = get_current_thread_ptr_for_domain (domain, internal);
return *current_thread_ptr != NULL;
}
MonoInternalThread* MonoInternalThread*
mono_thread_internal_current (void) mono_thread_internal_current (void)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册