ClickHouse/dbms/src/Common/setThreadName.cpp

11 lines
255 B
C++
Raw Normal View History

#include <sys/prctl.h>
#include <DB/Core/Exception.h>
#include <DB/Common/setThreadName.h>
void setThreadName(const char * name)
{
if (0 != prctl(PR_SET_NAME, name, 0, 0, 0))
DB::throwFromErrno("Cannot set thread name with prctl(PR_SET_NAME...)");
}