Skip to content

Commit 7c4cffd

Browse files
authored
[compiler-rt][fuzzer] SetThreadName build fix for Mingwin attempt (#106902)
1 parent 24a043a commit 7c4cffd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ size_t PageSize() {
239239
}
240240

241241
void SetThreadName(std::thread &thread, const std::string &name) {
242+
#if !defined(__MINGW32__)
242243
typedef HRESULT(WINAPI * proc)(HANDLE, PCWSTR);
243244
HMODULE kbase = GetModuleHandleA("KernelBase.dll");
244245
proc ThreadNameProc = reinterpret_cast<proc>(
@@ -253,6 +254,9 @@ void SetThreadName(std::thread &thread, const std::string &name) {
253254
}
254255
}
255256
}
257+
#else
258+
(void)pthread_setname_np(thread.native_handle(), name.c_str());
259+
#endif
256260
}
257261

258262
} // namespace fuzzer

0 commit comments

Comments
 (0)