Rémi Bernon (@rbernon) commented about server/thread.c:
+{ + struct thread *thread = private; + int priority_class = thread->process->priority, priority = thread->priority; + apply_thread_priority( thread, priority_class, priority, TRUE ); +} + +static void apply_thread_priority( struct thread *thread, int priority_class, int priority, int delayed ) +{ + if (!delayed && thread->delay_priority) remove_timeout_user( thread->delay_priority ); + thread->delay_priority = NULL; + + if (thread->unix_tid == -1) + { + thread->delay_priority = add_timeout_user( -TICKS_PER_SEC, delayed_set_thread_priority, thread ); + return; + } I'm not completely sure why I used a timer here, it's perhaps only historical from a time where we tried to use rtkit (which can't work). It'd probably be better to re-apply the current priority when unix_tid is set.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/4551#note_54377