aboutsummaryrefslogtreecommitdiff
path: root/nptl/pthread_setschedprio.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-08-14 23:11:18 +0000
committerUlrich Drepper <drepper@redhat.com>2006-08-14 23:11:18 +0000
commitf17efcb43e500d4af62b71bd6f286af831069b5a (patch)
treebf062a11f158b5bc8e33e42cc85e625751bacf94 /nptl/pthread_setschedprio.c
parent107b8a922a9f72bae8d066549c675062bee0897f (diff)
downloadglibc-f17efcb43e500d4af62b71bd6f286af831069b5a.tar
glibc-f17efcb43e500d4af62b71bd6f286af831069b5a.tar.gz
glibc-f17efcb43e500d4af62b71bd6f286af831069b5a.tar.bz2
glibc-f17efcb43e500d4af62b71bd6f286af831069b5a.zip
* sysdeps/powerpc/powerpc32/dl-trampoline.S (_dl_runtime_resolve):
Don't clobber caller's LRSAVE. (_dl_prof_resolve): Likewise.
Diffstat (limited to 'nptl/pthread_setschedprio.c')
-rw-r--r--nptl/pthread_setschedprio.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/nptl/pthread_setschedprio.c b/nptl/pthread_setschedprio.c
index 063f5232f5..4a71f6c7b3 100644
--- a/nptl/pthread_setschedprio.c
+++ b/nptl/pthread_setschedprio.c
@@ -47,6 +47,11 @@ pthread_setschedprio (threadid, prio)
lll_lock (pd->lock);
+ /* If the thread should have higher priority because of some
+ PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
+ if (__builtin_expect (pd->tpp != NULL, 0) && pd->tpp->priomax > prio)
+ param.sched_priority = pd->tpp->priomax;
+
/* Try to set the scheduler information. */
if (__builtin_expect (sched_setparam (pd->tid, &param) == -1, 0))
result = errno;
@@ -54,6 +59,7 @@ pthread_setschedprio (threadid, prio)
{
/* We succeeded changing the kernel information. Reflect this
change in the thread descriptor. */
+ param.sched_priority = prio;
memcpy (&pd->schedparam, &param, sizeof (struct sched_param));
pd->flags |= ATTR_FLAG_SCHED_SET;
}