>> setschedparam()? no, it's for real time thread mess. please don't use it.
>
> But setpriority always modifies the current thread. :-/ The API of
> #priority= is supposed to allow changing the priority from another
> thread.

Nope. setpriority() have pid argument, it can be passed thread-id.
see gettid() syscall. pthread_t is pthread level thread identifier. tid is
kernel level thread identifier.