Minor changes

This commit is contained in:
Alexey Milovidov 2023-05-03 22:51:56 +02:00
parent a90c2ec90d
commit 50202c1b0a

View File

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