From e46cf20f8c4474cb96b4db4239c8e3bd66248e00 Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Mon, 7 Apr 2025 09:04:43 +0200 Subject: Implement THREAD_SETNAME for mingw --- src/threading.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/threading.cpp b/src/threading.cpp index 3e594ff..3435075 100644 --- a/src/threading.cpp +++ b/src/threading.cpp @@ -449,7 +449,9 @@ void THREAD_SETNAME(std::string_view const& name_) { // exact API to set the thread name is platform-dependant // if you need to fix the build, or if you know how to fill a hole, tell me (bnt.germain@gmail.com) so that I can submit the fix in github. -#if defined PLATFORM_BSD && !defined __NetBSD__ +#if defined PLATFORM_MINGW + pthread_setname_np(pthread_self(), name_.data()); +#elif defined PLATFORM_BSD && !defined __NetBSD__ pthread_set_name_np(pthread_self(), name_.data()); #elif defined PLATFORM_BSD && defined __NetBSD__ pthread_setname_np(pthread_self(), "%s", (void*) name_.data()); -- cgit v1.2.3-55-g6feb