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.

Thread.cpp 699B

12345678910111213141516171819202122232425262728293031323334353637
  1. #include "il2cpp-config.h"
  2. #if IL2CPP_THREADS_PTHREAD && !IL2CPP_TARGET_DARWIN
  3. #include <pthread.h>
  4. #include "os/Thread.h"
  5. namespace il2cpp
  6. {
  7. namespace os
  8. {
  9. bool Thread::GetCurrentThreadStackBounds(void** low, void** high)
  10. {
  11. #if IL2CPP_TARGET_LINUX
  12. pthread_attr_t attr;
  13. size_t stacksize = 0;
  14. pthread_t self = pthread_self();
  15. int ret = pthread_getattr_np(self, &attr);
  16. if (ret != 0)
  17. return false;
  18. ret = pthread_attr_getstack(&attr, low, &stacksize);
  19. if (ret != 0)
  20. return false;
  21. *high = (void*)((uintptr_t)low + stacksize);
  22. return true;
  23. #else
  24. return false;
  25. #endif
  26. }
  27. }
  28. }
  29. #endif