Merge pull request #49476 from ClickHouse/minor-changes

Minor changes for setThreadName
This commit is contained in:
Alexey Milovidov 2023-05-05 04:02:30 +03:00 committed by GitHub
commit 38b2f94bfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,10 +30,8 @@ static thread_local char thread_name[THREAD_NAME_SIZE]{};
void setThreadName(const char * name)
{
#ifndef NDEBUG
if (strlen(name) > THREAD_NAME_SIZE - 1)
throw DB::Exception(DB::ErrorCodes::PTHREAD_ERROR, "Thread name cannot be longer than 15 bytes");
#endif
#if defined(OS_FREEBSD)
pthread_set_name_np(pthread_self(), name);