diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2024-10-21 11:01:02 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2024-10-21 11:01:02 +0000 |
| commit | e6b732792813cf49a23ba2f780c55f8d3279183e (patch) | |
| tree | 95a0ed209e2fb21f748e1151d801664be5790a8d /compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp | |
| parent | 0370629593a68f2e04a9710d201d120a2ce437d4 (diff) | |
Vendor import of llvm-project branch release/19.x llvmorg-19.1.2-0-g7ba7d8e2f7b6, a.k.a. 19.1.2 release.vendor/llvm-project/llvmorg-19.1.2-0-g7ba7d8e2f7b6
Diffstat (limited to 'compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp')
| -rw-r--r-- | compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp b/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp index db80eb383885..73eea07cf869 100644 --- a/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp +++ b/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp @@ -239,6 +239,10 @@ 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 typedef HRESULT(WINAPI * proc)(HANDLE, PCWSTR); HMODULE kbase = GetModuleHandleA("KernelBase.dll"); proc ThreadNameProc = @@ -253,6 +257,7 @@ void SetThreadName(std::thread &thread, const std::string &name) { } } } +#endif } } // namespace fuzzer |
