From 342ed2f161e33a3fadded0304e64c47a9c42e5ae Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 22 Jun 2016 08:27:24 +0200 Subject: [PATCH] Let Downloadmanager use new thread methods --- src/engine/downloadmanager.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/engine/downloadmanager.cpp b/src/engine/downloadmanager.cpp index c0716b34ea..816e8f2763 100644 --- a/src/engine/downloadmanager.cpp +++ b/src/engine/downloadmanager.cpp @@ -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 {