mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Fix synchronization of TPP min/max priorities.
* nptl/tpp.c (__init_sched_fifo_prio, __pthread_tpp_change_priority): Change synchronization of __sched_fifo_min_prio and __sched_fifo_max_prio. * nptl/pthread_mutexattr_getprioceiling.c (pthread_mutexattr_getprioceiling): Likewise. * nptl/pthread_mutexattr_setprioceiling.c (pthread_mutexattr_setprioceiling): Likewise. * nptl/pthread_mutex_init.c (__pthread_mutex_init): Likewise. * nptl/pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Likewise.
This commit is contained in:
@ -22,6 +22,7 @@
|
||||
#include <string.h>
|
||||
#include <kernel-features.h>
|
||||
#include "pthreadP.h"
|
||||
#include <atomic.h>
|
||||
|
||||
#include <stap-probe.h>
|
||||
|
||||
@ -117,10 +118,11 @@ __pthread_mutex_init (mutex, mutexattr)
|
||||
>> PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT;
|
||||
if (! ceiling)
|
||||
{
|
||||
if (__sched_fifo_min_prio == -1)
|
||||
/* See __init_sched_fifo_prio. */
|
||||
if (atomic_load_relaxed (&__sched_fifo_min_prio) == -1)
|
||||
__init_sched_fifo_prio ();
|
||||
if (ceiling < __sched_fifo_min_prio)
|
||||
ceiling = __sched_fifo_min_prio;
|
||||
if (ceiling < atomic_load_relaxed (&__sched_fifo_min_prio))
|
||||
ceiling = atomic_load_relaxed (&__sched_fifo_min_prio);
|
||||
}
|
||||
mutex->__data.__lock = ceiling << PTHREAD_MUTEX_PRIO_CEILING_SHIFT;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user