1

As the title described, you may answer that it can be gotten by JNI invoking (java.lang.Thread.currentThread().getId()). But actually it did not work because in Android 5.0 JNI invoking may cause "java.lang.StackOverflowError" (described in java.lang.StackOverflow Error for Android L preview running art). So I create a linux thread by calling pthread_create and try to make JNI invoking in this thread. But how to get pre-thread object(java.lang.Thread) before I create the new linux thread for I need to do something with that pre-thread. Because java thread dose not map the linux thread, so gettid() dose not work too. Is there anybody can help? Sincerely thanks.

Community
  • 1
  • 1
Jalen
  • 33
  • 6

0 Answers0