title: How to get java thread ID in Native?
body: <p>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 <a href="https://stackoverflow.com/questions/26385578/java-lang-stackoverflow-error-for-android-l-preview-running-art">java.lang.StackOverflow Error for Android L preview running art</a>). 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.</p>