I'm trying to profile my code using the Android Profiler. The problem is naming my C++ threads, I've tried using:
pthread_setname_np(pthread_self(), "MyThread");
But it doesn't show the specified name. How can I name my C++ thread on Android?
I'm trying to profile my code using the Android Profiler. The problem is naming my C++ threads, I've tried using:
pthread_setname_np(pthread_self(), "MyThread");
But it doesn't show the specified name. How can I name my C++ thread on Android?
JavaVM* jvm;
env->GetJavaVM(&jvm);
std::thread myThread([jvm](){
JNIEnv* myNewEnv;
JavaVMAttachArgs args;
args.version = JNI_VERSION_1_6;
args.name = "Fancy Thread";
args.group = NULL;
jvm->AttachCurrentThread((JNIEnv**)&myNewEnv, &args);
while(1){
// ....
}
});