From f65bf063bcac0dcdca7d3b7b865e29c837566543 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 21 Nov 2024 13:55:29 +0100 Subject: Vendor import of llvm-project branch release/19.x llvmorg-19.1.4-0-gaadaa00de76e, a.k.a. 19.1.4 release. --- compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp') diff --git a/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp b/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp index 73eea07cf869..da3eb3cfb340 100644 --- a/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp +++ b/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp @@ -239,10 +239,11 @@ size_t PageSize() { } void SetThreadName(std::thread &thread, const std::string &name) { -#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) || \ - defined(_GLIBCXX_GCC_GTHR_POSIX_H) - (void)pthread_setname_np(thread.native_handle(), name.c_str()); -#else +#ifndef __MINGW32__ + // Not setting the thread name in MinGW environments. MinGW C++ standard + // libraries can either use native Windows threads or pthreads, so we + // don't know with certainty what kind of thread handle we're getting + // from thread.native_handle() here. typedef HRESULT(WINAPI * proc)(HANDLE, PCWSTR); HMODULE kbase = GetModuleHandleA("KernelBase.dll"); proc ThreadNameProc = -- cgit v1.3