mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-05 14:31:17 +12:00
set AIR cache thread priority
This commit is contained in:
parent
2a218d418f
commit
6cf7f437a7
1 changed files with 18 additions and 3 deletions
|
@ -35,7 +35,18 @@ public:
|
|||
s_threads.emplace_back(&ShaderMtlThreadPool::CompilerThreadFunc, this);
|
||||
|
||||
// Create AIR cache thread
|
||||
s_airCacheThread = new std::thread(&ShaderMtlThreadPool::AIRCacheThreadFunc, this);
|
||||
s_airCacheThread = new std::thread(&ShaderMtlThreadPool::AIRCacheThreadFunc, this);
|
||||
|
||||
// Set priority
|
||||
sched_param schedParam;
|
||||
schedParam.sched_priority = 20;
|
||||
if (pthread_setschedparam(s_airCacheThread->native_handle(), SCHED_FIFO, &schedParam) != 0) {
|
||||
cemuLog_log(LogType::Force, "failed to set FIFO thread priority");
|
||||
}
|
||||
|
||||
if (pthread_setschedparam(s_airCacheThread->native_handle(), SCHED_RR, &schedParam) != 0) {
|
||||
cemuLog_log(LogType::Force, "failed to set RR thread priority");
|
||||
}
|
||||
}
|
||||
|
||||
void StopThreads()
|
||||
|
@ -48,8 +59,12 @@ public:
|
|||
it.join();
|
||||
s_threads.clear();
|
||||
|
||||
s_airCacheThread->join();
|
||||
delete s_airCacheThread;
|
||||
if (s_airCacheThread)
|
||||
{
|
||||
s_airCacheQueueCount.increment();
|
||||
s_airCacheThread->join();
|
||||
delete s_airCacheThread;
|
||||
}
|
||||
}
|
||||
|
||||
~ShaderMtlThreadPool()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue