Alexandre Julliard (@julliard) commented about server/thread.c:
+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;
- if (thread->unix_tid == -1) return;
- /* FIXME: handle REALTIME class using SCHED_RR if possible, for now map it to highest non-realtime band */
- if (priority_class == PROCESS_PRIOCLASS_REALTIME) base_priority = 15;
+#ifdef HAVE_SETPRIORITY
- if (nice_limit < 0)
- {
niceness = get_unix_niceness( base_priority );
if (setpriority( PRIO_PROCESS, thread->unix_tid, niceness ) != 0)
fprintf( stderr, "wine: setpriority %d for pid %d failed: %d\n", niceness, thread->unix_tid, errno );
Errors should be handled and propagated to the caller, not printed on the console.