about summary refs log tree commit diff
path: root/nptl/pthread_mutexattr_getprioceiling.c
diff options
context:
space:
mode:
authorTorvald Riegel <triegel@redhat.com>2014-11-25 19:48:56 +0100
committerTorvald Riegel <triegel@redhat.com>2014-11-26 10:07:20 +0100
commitcdcb42d7f786fe5ee1ca60065924d0b5c6649dd0 (patch)
tree302e5e92ddcc5996250b9d5ee3ab578afaa128ef /nptl/pthread_mutexattr_getprioceiling.c
parentc82f5c0ce5c1c0180fca311ceb29fd2d59da7441 (diff)
downloadglibc-cdcb42d7f786fe5ee1ca60065924d0b5c6649dd0.tar.gz
glibc-cdcb42d7f786fe5ee1ca60065924d0b5c6649dd0.tar.xz
glibc-cdcb42d7f786fe5ee1ca60065924d0b5c6649dd0.zip
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.
Diffstat (limited to 'nptl/pthread_mutexattr_getprioceiling.c')
-rw-r--r--nptl/pthread_mutexattr_getprioceiling.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/nptl/pthread_mutexattr_getprioceiling.c b/nptl/pthread_mutexattr_getprioceiling.c
index c3e93fa655..df265e7410 100644
--- a/nptl/pthread_mutexattr_getprioceiling.c
+++ b/nptl/pthread_mutexattr_getprioceiling.c
@@ -18,6 +18,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <pthreadP.h>
+#include <atomic.h>
 
 
 int
@@ -35,10 +36,11 @@ pthread_mutexattr_getprioceiling (attr, prioceiling)
 
   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);
     }
 
   *prioceiling = ceiling;