-
Notifications
You must be signed in to change notification settings - Fork 626
Preserve thread name after attaching it to JVM #838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When native thread is attached to JVM, then it's name is taken from JavaVMAttachArgs. When no JavaVMAttachArgs, or no JavaVMAttachArgs::name passed, then JVM on its own decides on taming thread. Those names are not descriptive. To preserve thread name, pass the currently set thread name in JavaVMAttachArgs::name. pthread_getname_np was introduced in API 26, hence use more generic approach. Signed-off-by: Yauheni Khnykin <yauheni.khnykin@here.com>
also, not sure if you'd be interested in maybe helping out with creating a github action for building the Android library. Currently our CI system isn't building android to validate PRs like this. :) |
I may have a look at weekend |
looks good to me. If you think you can add a GitHub Action to do a test build for android, I'll wait on that and accept it as one PR ... |
I ended up adding a GitHub action, so I'll go ahead and merge this. Thanks! |
When native thread is attached to JVM, then it's name is taken from JavaVMAttachArgs. When no JavaVMAttachArgs, or no JavaVMAttachArgs::name passed, then JVM on its own decides on taming thread. Those names are not descriptive. To preserve thread name, pass the currently set thread name in JavaVMAttachArgs::name. pthread_getname_np was introduced in API 26, hence use more generic approach. Fixes #837 Authored By: Yauheni Khnykin (@Hsilgos)
When native thread is attached to JVM, then it's name is taken from JavaVMAttachArgs. When no JavaVMAttachArgs, or no JavaVMAttachArgs::name passed, then JVM on its own decides on taming thread. Those names are not descriptive. To preserve thread name, pass the currently set thread name in JavaVMAttachArgs::name. pthread_getname_np was introduced in API 26, hence use more generic approach.
Fixes: #837