MCPcopy Create free account
hub / github.com/ClassicOldSong/Apollo / adjust_thread_priority

Function adjust_thread_priority

src/platform/windows/misc.cpp:1081–1106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1079 }
1080
1081 void adjust_thread_priority(thread_priority_e priority) {
1082 int win32_priority;
1083
1084 switch (priority) {
1085 case thread_priority_e::low:
1086 win32_priority = THREAD_PRIORITY_BELOW_NORMAL;
1087 break;
1088 case thread_priority_e::normal:
1089 win32_priority = THREAD_PRIORITY_NORMAL;
1090 break;
1091 case thread_priority_e::high:
1092 win32_priority = THREAD_PRIORITY_ABOVE_NORMAL;
1093 break;
1094 case thread_priority_e::critical:
1095 win32_priority = THREAD_PRIORITY_HIGHEST;
1096 break;
1097 default:
1098 BOOST_LOG(error) << "Unknown thread priority: "sv << (int) priority;
1099 return;
1100 }
1101
1102 if (!SetThreadPriority(GetCurrentThread(), win32_priority)) {
1103 auto winerr = GetLastError();
1104 BOOST_LOG(warning) << "Unable to set thread priority to "sv << win32_priority << ": "sv << winerr;
1105 }
1106 }
1107
1108 void streaming_will_start() {
1109 static std::once_flag load_wlanapi_once_flag;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected