diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-07-12 18:26:36 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2007-07-12 18:26:36 +0000 |
commit | 0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (patch) | |
tree | 2ea1f8305970753e4a657acb2ccc15ca3eec8e2c /nptl/pthread_setschedprio.c | |
parent | 7d58530341304d403a6626d7f7a1913165fe2f32 (diff) | |
download | glibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.tar.gz |
2.5-18.1
Diffstat (limited to 'nptl/pthread_setschedprio.c')
-rw-r--r-- | nptl/pthread_setschedprio.c | 6 |
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, ¶m) == -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, ¶m, sizeof (struct sched_param)); pd->flags |= ATTR_FLAG_SCHED_SET; } |