diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2024-11-21 12:55:29 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2024-11-21 12:55:29 +0000 |
| commit | f65bf063bcac0dcdca7d3b7b865e29c837566543 (patch) | |
| tree | 2b5bd79e99c9aeed4082427ad8ae0f70b8852d6c /compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp | |
| parent | efdccd8358633400f927c74be0f7969bda1b3775 (diff) | |
Diffstat (limited to 'compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp')
| -rw-r--r-- | compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
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 = |
