Rémi Bernon (@rbernon) commented about server/thread.c:
- int throughput_qos, latency_qos;
- struct thread_extended_policy thread_extended_policy;
- struct thread_precedence_policy thread_precedence_policy;
- mach_port_t thread_port, process_port = thread->process->trace_data;
- if (!process_port) return;
- kr = mach_port_extract_right( process_port, thread->unix_tid,
MACH_MSG_TYPE_COPY_SEND, &thread_port, &type );
- if (kr != KERN_SUCCESS) return;
- /* base priority 15 is for time-critical threads, so not compute-bound */
- thread_extended_policy.timeshare = base_priority > 14 ? 0 : 1;
- thread_precedence_policy.importance = get_mach_importance( base_priority );
- /* adapted from the QoS table at xnu/osfmk/kern/thread_policy.c */
- switch (thread->priority)
- {
case THREAD_PRIORITY_IDLE: /* THREAD_QOS_MAINTENANCE */
Nit: wineserver style doesn't indent cases.