summary refs log tree commit diff
diff options
context:
space:
mode:
authorTulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>2017-01-20 16:32:29 -0200
committerTulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>2017-01-20 16:40:30 -0200
commiteb1321f291515dae75c83a40c39e775fdd38e97a (patch)
tree900ea9a75d2f96d7756b8b3cc09647bd8413a89b
parent6d523660e9f9f18e6c497d2d882c644e9c1b1c29 (diff)
downloadglibc-eb1321f291515dae75c83a40c39e775fdd38e97a.tar.gz
glibc-eb1321f291515dae75c83a40c39e775fdd38e97a.tar.xz
glibc-eb1321f291515dae75c83a40c39e775fdd38e97a.zip
powerpc: Fix adapt_count update in __lll_unlock_elision
Commit e9a96ea1aca4ebaa7c86e8b83b766f118d689d0f had an error that
prevents adapt_count from being updated in __lll_unlock_elision.
-rw-r--r--ChangeLog5
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/elision-unlock.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9573c5c4b2..d90569fd69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-01-20  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
+
+	* sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
+	(__lll_unlock_elision): Fix adapt_count decrement.
+
 2017-01-14  Martin Galvan  <martingalvan@sourceware.org>
 
 	* README.pretty-printers (Known issues): Warn about printers not
diff --git a/sysdeps/unix/sysv/linux/powerpc/elision-unlock.c b/sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
index 759c1464a7..e3fe58e3f1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
+++ b/sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
@@ -35,7 +35,7 @@ __lll_unlock_elision (int *lock, short *adapt_count, int pshared)
 	 the mutex destruction requirements.  */
       short __tmp = atomic_load_relaxed (adapt_count);
       if (__tmp > 0)
-	atomic_store_relaxed (adapt_count, __tmp--);
+	atomic_store_relaxed (adapt_count, __tmp - 1);
 
       lll_unlock ((*lock), pshared);
     }