Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Util/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,9 @@ string getThreadName() {
string ret;
ret.resize(32);
auto tid = pthread_self();
pthread_getname_np(tid, (char *) ret.data(), ret.size());
#if defined(__GLIBC__)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个代码如果被屏蔽了 那用什么替代这个功能呢?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

若是不支持的话,就是走后面的默认逻辑了,以tid替代相应的name

pthread_getname_np(tid, (char*)ret.data(), ret.size());
#endif
if (ret[0]) {
ret.resize(strlen(ret.data()));
return ret;
Expand Down