Skip to content

Commit 54d71d7

Browse files
authored
Merge branch 'release/19.x' into rethrow_fix_backport
2 parents 9d61762 + d174e2a commit 54d71d7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,11 @@ size_t PageSize() {
239239
}
240240

241241
void SetThreadName(std::thread &thread, const std::string &name) {
242-
#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) || \
243-
defined(_GLIBCXX_GCC_GTHR_POSIX_H)
244-
(void)pthread_setname_np(thread.native_handle(), name.c_str());
245-
#else
242+
#ifndef __MINGW32__
243+
// Not setting the thread name in MinGW environments. MinGW C++ standard
244+
// libraries can either use native Windows threads or pthreads, so we
245+
// don't know with certainty what kind of thread handle we're getting
246+
// from thread.native_handle() here.
246247
typedef HRESULT(WINAPI * proc)(HANDLE, PCWSTR);
247248
HMODULE kbase = GetModuleHandleA("KernelBase.dll");
248249
proc ThreadNameProc =

0 commit comments

Comments
 (0)