Rémi Bernon (@rbernon) commented about server/thread.c:
+#ifdef __linux__ +static int get_unix_niceness( int base_priority, int limit ) +{ + int min = -limit, max = limit, range = max - min; + return min + (base_priority - 1) * range / 14; +} +#endif + #define THREAD_PRIORITY_REALTIME_HIGHEST 6 #define THREAD_PRIORITY_REALTIME_LOWEST -7
+static void apply_thread_priority( struct thread *thread, int priority_class, int priority ) +{ + int base_priority = get_base_priority( priority_class, priority ); +#ifdef __linux__ + int niceness, limit = min( nice_limit, thread->process->nice_limit ); As nice_limit is usually negative, I think this should be max instead, as `wineserver` will be calling call `setpriority`?
```suggestion:-0+0 int niceness, limit = max( nice_limit, thread->process->nice_limit ); ``` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4551#note_54608