No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ScopedThreadAttacher.cpp 506B

123456789101112131415161718
  1. #include "il2cpp-config.h"
  2. #include "vm/Thread.h"
  3. #include "vm/Domain.h"
  4. #include "vm/Runtime.h"
  5. #include "ScopedThreadAttacher.h"
  6. il2cpp::vm::ScopedThreadAttacher::ScopedThreadAttacher()
  7. : m_AttachedThread(NULL)
  8. {
  9. if (il2cpp::vm::Thread::Current() == NULL)
  10. m_AttachedThread = il2cpp::vm::Thread::Attach(il2cpp::vm::Domain::GetRoot());
  11. }
  12. il2cpp::vm::ScopedThreadAttacher::~ScopedThreadAttacher()
  13. {
  14. if (m_AttachedThread != NULL)
  15. il2cpp::vm::Thread::Detach(m_AttachedThread);
  16. }