@ -35,7 +35,7 @@ namespace AZStd
void SetThreadPriority ( int priority , pthread_attr_t & attr )
void SetThreadPriority ( int priority , pthread_attr_t & attr )
{
{
if ( priority = = - 1 )
if ( priority < = - 1 )
{
{
pthread_attr_setinheritsched ( & attr , PTHREAD_INHERIT_SCHED ) ;
pthread_attr_setinheritsched ( & attr , PTHREAD_INHERIT_SCHED ) ;
}
}
@ -59,5 +59,18 @@ namespace AZStd
thread_policy_set ( mach_thread , THREAD_AFFINITY_POLICY , ( thread_policy_t ) & policyData , 1 ) ;
thread_policy_set ( mach_thread , THREAD_AFFINITY_POLICY , ( thread_policy_t ) & policyData , 1 ) ;
}
}
}
}
//////////////////////////////////////////////////////////////////////////////////
// Apple pthread -> NSThread quality of service level map
// QOS class name | min pthread priority | max pthread priority | comment
// QOS_CLASS_USER_INTERACTIVE | 38 | 47 | Per-frame work
// QOS_CLASS_USER_INITIATED | 32 | 37 | Asynchronous / Cross frame work
// QOS_CLASS_DEFAULT | 21 | 31 | Streaming / Multiple frames deadline
// QOS_CLASS_UTILITY | 5 | 20 | Background asset download
// QOS_CLASS_BACKGROUN | 0 | 4 | Will be prevented from using whole core.
uint8_t GetDefaultThreadPriority ( )
{
return 10 ;
}
}
}
}
}