少年修仙传客户端基础资源
dabaoji
2024-06-05 ccd83bfce7f8e13edd78f135a5edfb6d92beac70
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "il2cpp-config.h"
#include "vm/Thread.h"
#include "vm/Domain.h"
#include "ScopedThreadAttacher.h"
 
il2cpp::vm::ScopedThreadAttacher::ScopedThreadAttacher()
    : m_AttachedThread(NULL)
{
    if (il2cpp::vm::Thread::Current() == NULL)
        m_AttachedThread = il2cpp::vm::Thread::Attach(il2cpp::vm::Domain::GetRoot());
}
 
il2cpp::vm::ScopedThreadAttacher::~ScopedThreadAttacher()
{
    if (m_AttachedThread != NULL)
        il2cpp::vm::Thread::Detach(m_AttachedThread);
}