fix pthread_setname_np on linux
Some checks failed
rpcrypto-build / build (Release, himix200.toolchain.cmake) (push) Failing after 47s
rpcrypto-build / build (Debug, himix200.toolchain.cmake) (push) Failing after 1m2s
rpcrypto-build / build (Release, hisiv510.toolchain.cmake) (push) Failing after 1m7s
linux-mips64-gcc / linux-gcc-mips64el (push) Failing after 1m8s
rpcrypto-build / build (Debug, hisiv510.toolchain.cmake) (push) Failing after 1m11s
linux-x64-gcc / linux-gcc (push) Failing after 58s
linux-hisiv500-gcc / linux-gcc-hisiv500 (push) Failing after 1m4s

This commit is contained in:
tqcq 2023-12-28 12:51:01 +08:00
parent 3a7c9d5d19
commit e17beb8d24

View File

@ -18,7 +18,7 @@ GetTid()
class Thread::Impl { class Thread::Impl {
public: public:
Impl(const ThreadFunc &func, const std::string &thread_name) Impl(const ThreadFunc &func, const std::string &thread_name)
: thread_(0), : thread_(nullptr),
started_(false), started_(false),
joined_(false), joined_(false),
thread_name_(thread_name), thread_name_(thread_name),
@ -39,7 +39,7 @@ public:
#if __APPLE__ #if __APPLE__
pthread_setname_np(impl->thread_name_.c_str()); pthread_setname_np(impl->thread_name_.c_str());
#else #else
pthread_setname_np(&thread_, impl->thread_name_.c_str()); pthread_setname_np(&impl->thread_, impl->thread_name_.c_str());
#endif #endif
impl->latch_.CountDown(); impl->latch_.CountDown();