@@ -3939,7 +3939,6 @@ _dispatch_workloop_has_kernel_attributes(dispatch_workloop_t dwl)
3939
3939
DISPATCH_WORKLOOP_ATTR_HAS_POLICY |
3940
3940
DISPATCH_WORKLOOP_ATTR_HAS_CPUPERCENT ));
3941
3941
}
3942
- #endif // TARGET_OS_MAC
3943
3942
3944
3943
void
3945
3944
dispatch_workloop_set_scheduler_priority (dispatch_workloop_t dwl , int priority ,
@@ -3963,6 +3962,7 @@ dispatch_workloop_set_scheduler_priority(dispatch_workloop_t dwl, int priority,
3963
3962
dwl -> dwl_attr -> dwla_flags &= ~DISPATCH_WORKLOOP_ATTR_HAS_POLICY ;
3964
3963
}
3965
3964
}
3965
+ #endif // TARGET_OS_MAC
3966
3966
3967
3967
void
3968
3968
dispatch_workloop_set_qos_class_floor (dispatch_workloop_t dwl ,
@@ -3981,12 +3981,16 @@ dispatch_workloop_set_qos_class_floor(dispatch_workloop_t dwl,
3981
3981
dwl -> dwl_attr -> dwla_flags &= ~DISPATCH_WORKLOOP_ATTR_HAS_QOS_CLASS ;
3982
3982
}
3983
3983
3984
+ #if TARGET_OS_MAC
3984
3985
if (flags & DISPATCH_WORKLOOP_FIXED_PRIORITY ) {
3985
3986
dwl -> dwl_attr -> dwla_policy = POLICY_RR ;
3986
3987
dwl -> dwl_attr -> dwla_flags |= DISPATCH_WORKLOOP_ATTR_HAS_POLICY ;
3987
3988
} else {
3988
3989
dwl -> dwl_attr -> dwla_flags &= ~DISPATCH_WORKLOOP_ATTR_HAS_POLICY ;
3989
3990
}
3991
+ #else // TARGET_OS_MAC
3992
+ (void )flags ;
3993
+ #endif // TARGET_OS_MAC
3990
3994
}
3991
3995
3992
3996
void
@@ -4034,7 +4038,6 @@ _dispatch_workloop_activate_simulator_fallback(dispatch_workloop_t dwl,
4034
4038
new_state |= DISPATCH_QUEUE_ROLE_BASE_ANON ;
4035
4039
});
4036
4040
}
4037
- #endif // TARGET_OS_MAC
4038
4041
4039
4042
static const struct dispatch_queue_global_s _dispatch_custom_workloop_root_queue = {
4040
4043
DISPATCH_GLOBAL_OBJECT_HEADER (queue_global ),
@@ -4047,6 +4050,7 @@ static const struct dispatch_queue_global_s _dispatch_custom_workloop_root_queue
4047
4050
.dq_serialnum = DISPATCH_QUEUE_SERIAL_NUMBER_WLF ,
4048
4051
.dgq_thread_pool_size = 1 ,
4049
4052
};
4053
+ #endif // TARGET_OS_MAC
4050
4054
4051
4055
static void
4052
4056
_dispatch_workloop_activate_attributes (dispatch_workloop_t dwl )
@@ -4058,6 +4062,7 @@ _dispatch_workloop_activate_attributes(dispatch_workloop_t dwl)
4058
4062
if (dwla -> dwla_flags & DISPATCH_WORKLOOP_ATTR_HAS_QOS_CLASS ) {
4059
4063
dwl -> dq_priority |= dwla -> dwla_pri | DISPATCH_PRIORITY_FLAG_FLOOR ;
4060
4064
}
4065
+ #if TARGET_OS_MAC
4061
4066
if (dwla -> dwla_flags & DISPATCH_WORKLOOP_ATTR_HAS_SCHED ) {
4062
4067
pthread_attr_setschedparam (& attr , & dwla -> dwla_sched );
4063
4068
// _dispatch_async_and_wait_should_always_async detects when a queue
@@ -4070,6 +4075,7 @@ _dispatch_workloop_activate_attributes(dispatch_workloop_t dwl)
4070
4075
if (dwla -> dwla_flags & DISPATCH_WORKLOOP_ATTR_HAS_POLICY ) {
4071
4076
pthread_attr_setschedpolicy (& attr , dwla -> dwla_policy );
4072
4077
}
4078
+ #endif // TARGET_OS_MAC
4073
4079
#if HAVE_PTHREAD_ATTR_SETCPUPERCENT_NP
4074
4080
if (dwla -> dwla_flags & DISPATCH_WORKLOOP_ATTR_HAS_CPUPERCENT ) {
4075
4081
pthread_attr_setcpupercent_np (& attr , dwla -> dwla_cpupercent .percent ,
0 commit comments