X-Git-Url: https://git.saurik.com/apple/libpthread.git/blobdiff_plain/215aeb0310146fee62c0f2602966571180f8eb63..964d3577b041867f776d8eb940bf4a1108ffb97c:/src/qos.c?ds=inline diff --git a/src/qos.c b/src/qos.c index 1213695..485b93b 100644 --- a/src/qos.c +++ b/src/qos.c @@ -42,8 +42,8 @@ static pthread_priority_t _main_qos = QOS_CLASS_UNSPECIFIED; struct pthread_override_s { uint32_t sig; - pthread_t pthread; mach_port_t kthread; + pthread_t pthread; pthread_priority_t priority; bool malloced; }; @@ -344,6 +344,20 @@ pthread_set_fixedpriority_self(void) } } +int +pthread_set_timeshare_self(void) +{ + if (!(__pthread_supported_features & PTHREAD_FEATURE_BSDTHREADCTL)) { + return ENOTSUP; + } + + if (__pthread_supported_features & PTHREAD_FEATURE_SETSELF) { + return _pthread_set_properties_self(_PTHREAD_SET_SELF_TIMESHARE_FLAG, 0, 0); + } else { + return ENOTSUP; + } +} + pthread_override_t pthread_override_qos_class_start_np(pthread_t __pthread, qos_class_t __qos_class, int __relative_priority)