MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / setThreadAffinity

Function setThreadAffinity

Source/Falcor/Core/Platform/Windows/Windows.cpp:852–871  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

850}
851
852void 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
873void setThreadPriority(std::thread::native_handle_type thread, ThreadPriorityType priority)
874{

Callers

nothing calls this directly

Calls 2

wstring_2_stringFunction · 0.85
logWarningFunction · 0.50

Tested by

no test coverage detected