glibc版本低于2.12可能不支持pthread_setname_np。 尝试在不同的操作系统或环境下测试pthread_setname_np函数: 如果在某个特定环境下pthread_setname_np无效,尝试在其他操作系统或环境下运行相同的代码,看是否能成功设置线程名。 这有助于确定问题是出在代码本身还是环境兼容性上。 寻求专业开发者社区的帮助
另外,pthread_setname_np的名字不能超过16字节,所以请不要设一个太长的名字。 https://android.googlesource.com/platform/bionic/+/40eabe2/libc/bionic/pthread_setname_np.cpp