Rémi Bernon (@rbernon) commented about server/thread.c:
return mask; }
+static int get_base_priority( int priority_class, int priority ) +{ + static const int class_offsets[] = { 4, 8, 13, 24, 6, 10 }; + if (priority == THREAD_PRIORITY_IDLE) return (priority_class == PROCESS_PRIOCLASS_REALTIME ? 16 : 1); + if (priority == THREAD_PRIORITY_TIME_CRITICAL) return (priority_class == PROCESS_PRIOCLASS_REALTIME ? 31 : 15); + if (priority_class >= ARRAY_SIZE(class_offsets)) return 16;
Sorry, I forgot where that computation came from, but I found it again (https://learn.microsoft.com/en-us/windows/win32/procthread/scheduling-priori...) and the neutral base priority is 8 (which then also explains the `(base_priority - 1) / 14` below. ```suggestion:-0+0 if (priority_class >= ARRAY_SIZE(class_offsets)) return 8; ``` Could you maybe add a small comment too? Thanks! -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4551#note_54733