@@ -3994,7 +3994,6 @@ _dispatch_workloop_has_kernel_attributes(dispatch_workloop_t dwl)
3994
3994
DISPATCH_WORKLOOP_ATTR_HAS_POLICY |
3995
3995
DISPATCH_WORKLOOP_ATTR_HAS_CPUPERCENT));
3996
3996
}
3997
- #endif // TARGET_OS_MAC
3998
3997
3999
3998
void
4000
3999
dispatch_workloop_set_scheduler_priority(dispatch_workloop_t dwl, int priority,
@@ -4018,6 +4017,7 @@ dispatch_workloop_set_scheduler_priority(dispatch_workloop_t dwl, int priority,
4018
4017
dwl->dwl_attr->dwla_flags &= ~DISPATCH_WORKLOOP_ATTR_HAS_POLICY;
4019
4018
}
4020
4019
}
4020
+ #endif // TARGET_OS_MAC
4021
4021
4022
4022
void
4023
4023
dispatch_workloop_set_qos_class_floor(dispatch_workloop_t dwl,
@@ -4036,12 +4036,16 @@ dispatch_workloop_set_qos_class_floor(dispatch_workloop_t dwl,
4036
4036
dwl->dwl_attr->dwla_flags &= ~DISPATCH_WORKLOOP_ATTR_HAS_QOS_CLASS;
4037
4037
}
4038
4038
4039
+ #if TARGET_OS_MAC
4039
4040
if (flags & DISPATCH_WORKLOOP_FIXED_PRIORITY) {
4040
4041
dwl->dwl_attr->dwla_policy = POLICY_RR;
4041
4042
dwl->dwl_attr->dwla_flags |= DISPATCH_WORKLOOP_ATTR_HAS_POLICY;
4042
4043
} else {
4043
4044
dwl->dwl_attr->dwla_flags &= ~DISPATCH_WORKLOOP_ATTR_HAS_POLICY;
4044
4045
}
4046
+ #else // TARGET_OS_MAC
4047
+ (void)flags;
4048
+ #endif // TARGET_OS_MAC
4045
4049
}
4046
4050
4047
4051
void
@@ -4102,7 +4106,6 @@ _dispatch_workloop_activate_simulator_fallback(dispatch_workloop_t dwl,
4102
4106
new_state |= DISPATCH_QUEUE_ROLE_BASE_ANON;
4103
4107
});
4104
4108
}
4105
- #endif // TARGET_OS_MAC
4106
4109
4107
4110
static const struct dispatch_queue_global_s _dispatch_custom_workloop_root_queue = {
4108
4111
DISPATCH_GLOBAL_OBJECT_HEADER(queue_global),
@@ -4115,6 +4118,7 @@ static const struct dispatch_queue_global_s _dispatch_custom_workloop_root_queue
4115
4118
.dq_serialnum = DISPATCH_QUEUE_SERIAL_NUMBER_WLF,
4116
4119
.dgq_thread_pool_size = 1,
4117
4120
};
4121
+ #endif // TARGET_OS_MAC
4118
4122
4119
4123
static void
4120
4124
_dispatch_workloop_activate_attributes(dispatch_workloop_t dwl)
@@ -4126,6 +4130,7 @@ _dispatch_workloop_activate_attributes(dispatch_workloop_t dwl)
4126
4130
if (dwla->dwla_flags & DISPATCH_WORKLOOP_ATTR_HAS_QOS_CLASS) {
4127
4131
dwl->dq_priority |= dwla->dwla_pri | DISPATCH_PRIORITY_FLAG_FLOOR;
4128
4132
}
4133
+ #if TARGET_OS_MAC
4129
4134
if (dwla->dwla_flags & DISPATCH_WORKLOOP_ATTR_HAS_SCHED) {
4130
4135
pthread_attr_setschedparam(&attr, &dwla->dwla_sched);
4131
4136
// _dispatch_async_and_wait_should_always_async detects when a queue
@@ -4138,6 +4143,7 @@ _dispatch_workloop_activate_attributes(dispatch_workloop_t dwl)
4138
4143
if (dwla->dwla_flags & DISPATCH_WORKLOOP_ATTR_HAS_POLICY) {
4139
4144
pthread_attr_setschedpolicy(&attr, dwla->dwla_policy);
4140
4145
}
4146
+ #endif // TARGET_OS_MAC
4141
4147
#if HAVE_PTHREAD_ATTR_SETCPUPERCENT_NP
4142
4148
if (dwla->dwla_flags & DISPATCH_WORKLOOP_ATTR_HAS_CPUPERCENT) {
4143
4149
pthread_attr_setcpupercent_np(&attr, dwla->dwla_cpupercent.percent,
0 commit comments