10#if (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__))
12#include <pthread_np.h>
17#if __has_include(<sys/prctl.h>)
25#if defined(PR_SET_NAME)
27 ::prctl(PR_SET_NAME,
name, 0, 0, 0);
28#elif (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__))
29 pthread_set_name_np(pthread_self(),
name);
30#elif defined(__APPLE__)
31 pthread_setname_np(
name);
void ThreadRename(const std::string &)
std::string ThreadGetInternalName()
void ThreadSetInternalName(const std::string &)
Set the internal (in-memory) name of the current thread only.
static char g_thread_name[128]
The name of the thread.
static void SetInternalName(const std::string &name)
static void SetThreadName(const char *name)