Compare commits
1 commit
0bce00edc2
...
8e387dc156
Author | SHA1 | Date | |
---|---|---|---|
8e387dc156 |
1 changed files with 1 additions and 1 deletions
|
@ -109,7 +109,7 @@ void SetCurrentThreadName(const char* name) {
|
||||||
// attempt to set a longer name with ERANGE.
|
// attempt to set a longer name with ERANGE.
|
||||||
char buf[16];
|
char buf[16];
|
||||||
size_t const len = std::min<size_t>(std::strlen(name), sizeof(buf) - 1);
|
size_t const len = std::min<size_t>(std::strlen(name), sizeof(buf) - 1);
|
||||||
std::memcpy(truncated, name, len);
|
std::memcpy(buf, name, len);
|
||||||
buf[len] = '\0';
|
buf[len] = '\0';
|
||||||
pthread_setname_np(pthread_self(), buf);
|
pthread_setname_np(pthread_self(), buf);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue