- if ((__pthread_supported_features & PTHREAD_FEATURE_QOS_DEFAULT) == 0) {
- switch (queue_priority) {
- case WORKQ_HIGH_PRIOQUEUE:
- return _pthread_priority_make_version1(QOS_CLASS_USER_INTERACTIVE, 0, flags);
- case WORKQ_DEFAULT_PRIOQUEUE:
- return _pthread_priority_make_version1(QOS_CLASS_USER_INITIATED, 0, flags);
- case WORKQ_LOW_PRIOQUEUE:
- case WORKQ_NON_INTERACTIVE_PRIOQUEUE:
- return _pthread_priority_make_version1(QOS_CLASS_UTILITY, 0, flags);
- case WORKQ_BG_PRIOQUEUE:
- return _pthread_priority_make_version1(QOS_CLASS_BACKGROUND, 0, flags);
- default:
- __pthread_abort();
- }
- }
-
- if ((__pthread_supported_features & PTHREAD_FEATURE_QOS_MAINTENANCE) == 0) {
- switch (queue_priority) {
- case WORKQ_HIGH_PRIOQUEUE:
- return _pthread_priority_make_version2(QOS_CLASS_USER_INITIATED, 0, flags);
- case WORKQ_DEFAULT_PRIOQUEUE:
- return _pthread_priority_make_version2(QOS_CLASS_DEFAULT, 0, flags);
- case WORKQ_LOW_PRIOQUEUE:
- case WORKQ_NON_INTERACTIVE_PRIOQUEUE:
- return _pthread_priority_make_version2(QOS_CLASS_UTILITY, 0, flags);
- case WORKQ_BG_PRIOQUEUE:
- return _pthread_priority_make_version2(QOS_CLASS_BACKGROUND, 0, flags);
- /* Legacy dispatch does not use QOS_CLASS_MAINTENANCE, so no need to handle it here */
- default:
- __pthread_abort();
- }
- }
-