mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-14 17:40:26 -05:00
Let Downloadmanager use new thread methods
This commit is contained in:
@@ -348,8 +348,11 @@ void DownloadManager::downloadRequestFilesAsync(const std::string& identifier,
|
||||
};
|
||||
|
||||
if (_useMultithreadedDownload) {
|
||||
using namespace ghoul::thread;
|
||||
std::thread t = std::thread(downloadFunction);
|
||||
ghoul::thread::setPriority(t, ghoul::thread::ThreadPriority::Lowest);
|
||||
ghoul::thread::setPriority(
|
||||
t, ThreadPriorityClass::Idle, ThreadPriorityLevel::Lowest
|
||||
);
|
||||
t.detach();
|
||||
}
|
||||
else
|
||||
@@ -384,16 +387,11 @@ void DownloadManager::getFileExtension(const std::string& url,
|
||||
}
|
||||
};
|
||||
if (_useMultithreadedDownload) {
|
||||
using namespace ghoul::thread;
|
||||
std::thread t = std::thread(requestFunction);
|
||||
|
||||
#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, ThreadPriorityClass::Idle, ThreadPriorityLevel::Lowest
|
||||
);
|
||||
t.detach();
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user