mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-05 22:41:18 +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
|
@ -36,6 +36,17 @@ public:
|
||||||
|
|
||||||
// Create AIR cache thread
|
// 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()
|
void StopThreads()
|
||||||
|
@ -48,9 +59,13 @@ public:
|
||||||
it.join();
|
it.join();
|
||||||
s_threads.clear();
|
s_threads.clear();
|
||||||
|
|
||||||
|
if (s_airCacheThread)
|
||||||
|
{
|
||||||
|
s_airCacheQueueCount.increment();
|
||||||
s_airCacheThread->join();
|
s_airCacheThread->join();
|
||||||
delete s_airCacheThread;
|
delete s_airCacheThread;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
~ShaderMtlThreadPool()
|
~ShaderMtlThreadPool()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue