Make use of new thread priority scheme

Updated Ghoul repository
This commit is contained in:
Alexander Bock
2016-05-19 13:23:40 +02:00
parent 94bac5d886
commit caae5336b5
3 changed files with 10 additions and 10 deletions
-2
View File
@@ -92,11 +92,9 @@ return {
Body = "ROSETTA",
Frame = "GALACTIC",
Observer = "CHURYUMOV-GERASIMENKO",
-- 3 Dummy values for compilation:
TropicalOrbitPeriod = 20000.0,
EarthOrbitRatio = 2,
DayLength = 25,
-- End of Dummy values
RGB = { 0.9, 0.2, 0.9 },
Textures = {
Type = "simple",
+9 -7
View File
@@ -27,6 +27,7 @@
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/logging/logmanager.h>
#include <ghoul/misc/assert.h>
#include <ghoul/misc/thread.h>
#include <chrono>
#include <fstream>
@@ -274,13 +275,14 @@ void DownloadManager::downloadRequestFilesAsync(const std::string& identifier,
if (_useMultithreadedDownload) {
std::thread t = std::thread(downloadFunction);
#ifdef WIN32
std::thread::native_handle_type h = t.native_handle();
SetPriorityClass(h, IDLE_PRIORITY_CLASS);
SetThreadPriority(h, THREAD_PRIORITY_LOWEST);
#else
// TODO: Implement thread priority ---abock
#endif
ghoul::thread::setPriority(t, ghoul::thread::ThreadPriority::Lowest);
//#ifdef WIN32
// std::thread::native_handle_type h = t.native_handle();
// SetPriorityClass(h, IDLE_PRIORITY_CLASS);
// SetThreadPriority(h, THREAD_PRIORITY_LOWEST);
//#else
// // TODO: Implement thread priority ---abock
//#endif
t.detach();
}