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

Function setThreadPriority

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

Source from the content-addressed store, hash-verified

871}
872
873void setThreadPriority(std::thread::native_handle_type thread, ThreadPriorityType priority)
874{
875 if (priority >= ThreadPriorityType::Lowest)
876 ::SetThreadPriority(thread, THREAD_BASE_PRIORITY_MIN + (int32_t)priority);
877 else if (priority == ThreadPriorityType::BackgroundBegin)
878 ::SetThreadPriority(thread, THREAD_MODE_BACKGROUND_BEGIN);
879 else if (priority == ThreadPriorityType::BackgroundEnd)
880 ::SetThreadPriority(thread, THREAD_MODE_BACKGROUND_END);
881 else
882 FALCOR_UNREACHABLE();
883
884 if (DWORD dwError = GetLastError() != 0)
885 {
886 LPVOID lpMsgBuf;
887 FormatMessage(
888 FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
889 NULL,
890 dwError,
891 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
892 (LPTSTR)&lpMsgBuf,
893 0,
894 NULL
895 );
896 std::wstring err((LPTSTR)lpMsgBuf);
897 logWarning("setThreadPriority failed with error: {}", wstring_2_string(err));
898 LocalFree(lpMsgBuf);
899 }
900}
901
902time_t getFileModifiedTime(const std::filesystem::path& path)
903{

Callers

nothing calls this directly

Calls 2

wstring_2_stringFunction · 0.85
logWarningFunction · 0.50

Tested by

no test coverage detected