diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2022-12-09 16:34:28 -0500 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2022-12-09 16:34:28 -0500 |
commit | f41278082f2ab204ec60c15ee1530ca4440937a5 (patch) | |
tree | c382bb0e6cde299e853d09b19a47f1d82dc537fa /indra/llwindow | |
parent | fc424a0db90fd2d2e44e85a19750ad6eaa57b28a (diff) | |
parent | e3b34fec6962e6deda3dd9dd83bf9fa20ab594af (diff) |
SL-18809: Merge 'DRTVWR-559' of secondlife/viewer into sl-18809
Diffstat (limited to 'indra/llwindow')
-rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index c0d3424141..be5af8240f 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -467,7 +467,6 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, // process deprioritization during profiles // force high thread priority HANDLE hProcess = GetCurrentProcess(); - HANDLE hThread = GetCurrentThread(); if (hProcess) { @@ -484,6 +483,20 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, } } } +#endif + +#if 0 // this is also probably a bad idea, but keep it in your back pocket for getting main thread off of background thread cores (see also LLThread::threadRun) + HANDLE hThread = GetCurrentThread(); + + SYSTEM_INFO sysInfo; + + GetSystemInfo(&sysInfo); + U32 core_count = sysInfo.dwNumberOfProcessors; + + if (max_cores != 0) + { + core_count = llmin(core_count, max_cores); + } if (hThread) { @@ -499,6 +512,9 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, { LL_INFOS() << "Failed to set thread priority: " << std::hex << GetLastError() << LL_ENDL; } + + // tell main thread to prefer core 0 + SetThreadIdealProcessor(hThread, 0); } } #endif |