MCPcopy Create free account
hub / github.com/SpecialKO/SpecialK / DetachCurrentThreadIfNotNative

Function DetachCurrentThreadIfNotNative

src/plugins/unity.cpp:695–724  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

693}
694
695static
696bool DetachCurrentThreadIfNotNative (void)
697{
698 if (! SK_mono_thread_current)
699 {
700 if (Il2cpp::thread_detach != nullptr)
701 Il2cpp::thread_detach (Il2cpp::thread_current ());
702
703 return false;
704 }
705
706 MonoThread* this_thread =
707 SK_mono_thread_current ();
708
709 if (this_thread != nullptr)
710 {
711 // This API doesn't exist in older versions of Mono.
712 if (SK_mono_thread_is_foreign == nullptr ||
713 SK_mono_thread_is_foreign (this_thread))
714 {
715 SK_mono_thread_detach (this_thread);
716
717 SK_LOGi1 (L"Detached Non-Native Mono Thread: tid=%x", GetCurrentThreadId ());
718
719 return true;
720 }
721 }
722
723 return false;
724}
725
726class SK_Mono_ScopedThreadAttach
727{

Callers 3

Calls

no outgoing calls

Tested by

no test coverage detected