mirror of
https://github.com/uroni/urbackup_backend.git
synced 2025-10-26 11:36:50 +00:00
Reset power throttling after THREAD_MODE_BACKGROUND_BEGIN
This commit is contained in:
parent
5ef656eb63
commit
e95aa192a3
@ -1765,7 +1765,14 @@ std::string os_format_errcode(int64 errcode)
|
||||
bool os_enable_background_priority(SPrioInfo& prio_info)
|
||||
{
|
||||
#ifdef THREAD_MODE_BACKGROUND_BEGIN
|
||||
return SetThreadPriority(GetCurrentThread(), THREAD_MODE_BACKGROUND_BEGIN) == TRUE;
|
||||
bool b= SetThreadPriority(GetCurrentThread(), THREAD_MODE_BACKGROUND_BEGIN) == TRUE;
|
||||
if (b)
|
||||
{
|
||||
THREAD_POWER_THROTTLING_STATE ps = {};
|
||||
ps.Version = THREAD_POWER_THROTTLING_CURRENT_VERSION;
|
||||
SetThreadInformation(GetCurrentThread(), ThreadPowerThrottling, &ps, sizeof(ps));
|
||||
}
|
||||
return b;
|
||||
#else
|
||||
return SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_LOWEST)==TRUE;
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user