From 135c411bd573ac4e3b981d6679eff1f4c3682e04 Mon Sep 17 00:00:00 2001 From: kailixu Date: Thu, 12 Oct 2023 17:27:16 +0800 Subject: [PATCH] enh: set thread name for windows --- include/os/osDef.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/os/osDef.h b/include/os/osDef.h index c18728c9a7..bad4536fa6 100644 --- a/include/os/osDef.h +++ b/include/os/osDef.h @@ -225,7 +225,10 @@ void syslog(int unused, const char *format, ...); #endif #else // Windows -#define setThreadName(name) +#define setThreadName(name) \ + do { \ + pthread_setname_np(taosThreadSelf(), (name)); \ + } while (0) #endif #if defined(_WIN32)