| 850 | } |
| 851 | |
| 852 | void setThreadAffinity(std::thread::native_handle_type thread, uint32_t affinityMask) |
| 853 | { |
| 854 | ::SetThreadAffinityMask(thread, affinityMask); |
| 855 | if (DWORD dwError = GetLastError() != 0) |
| 856 | { |
| 857 | LPVOID lpMsgBuf; |
| 858 | FormatMessage( |
| 859 | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, |
| 860 | NULL, |
| 861 | dwError, |
| 862 | MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), |
| 863 | (LPTSTR)&lpMsgBuf, |
| 864 | 0, |
| 865 | NULL |
| 866 | ); |
| 867 | std::wstring err((LPTSTR)lpMsgBuf); |
| 868 | logWarning("setThreadAffinity failed with error: {}", wstring_2_string(err)); |
| 869 | LocalFree(lpMsgBuf); |
| 870 | } |
| 871 | } |
| 872 | |
| 873 | void setThreadPriority(std::thread::native_handle_type thread, ThreadPriorityType priority) |
| 874 | { |
nothing calls this directly
no test coverage detected