summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowwin32.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llwindow/llwindowwin32.cpp')
-rw-r--r--indra/llwindow/llwindowwin32.cpp18
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